In this writing, I'd like to share how I learned to create a Field Parameter in Fabric's Direct Lake Mode Semantic Model.
As I explored creating numerous field parameters during my Power BI development journey, I found that a field parameter is essentially a table created using DAX code. Here’s the method I typically use to create a field parameter, along with how the result looks:
As described above, the table contains three columns.
However, instead of using the UI as described above, creating a Calculated Table with the exact same DAX code produces a different outcome.
The column names appear differently.
When I attempted to add this to the visualization, it displayed the following error message.
This distinction arises because, while the DAX code itself remains unchanged, the context in which it is applied varies between a Field Parameter and a Calculated Table. As a result, the two approaches yield different visualizations and data structures within the model.
From that point onward, I tried to find a way to create a field parameter by writing DAX code to generate a calculated table that functions identically to a field parameter. Through this process, I learned that it is possible to create a field parameter in Fabric's Direct Lake Mode Semantic Model using Tabular Editor 3. This approach enables me to incorporate field parameters within the Direct Lake Mode Semantic Model, thereby enhancing the model's functionality.
I have detailed the steps for creating a field parameter in Fabric's Direct Lake Mode Semantic Model using Tabular Editor 3 below. I hope this enhances the experience of Direct Lake Mode and makes developing the Direct Lake Semantic Model in Fabric more enjoyable.
Let's start.
Open Tabular Editor 3, and then,
Remark:
Step 3: Locate the connection link for the workspace in the Workspace Settings.
Step 5: Choose a Direct Lake Semantic Model.
Remark:
Step 8: Rename the calculated table name to "field_parameter_measures."
Step 9: Copy and paste the following DAX code into Expression Editor window.
{
( "dax expression measure", NAMEOF( [dax expression measure] ), 0 ),
( "modified date measure", NAMEOF( [modified date measure] ), 1 ),
( "table name measure", NAMEOF( [table name measure] ), 2 )
}
The names of the three columns appear as shown below. The following steps describe renaming these column names.
Remark:
When renaming each column, ensure to set the "Name Inferred" option to False.
The following steps show setting up the `display_name` column.
Remark:
Step 16-2: Manually enter `Name: SummarizationSetBy` and `Value: Automatic`.
The following steps pictures setting up the `field_name` column.
Remark:
Step 21-2: Manually enter `Name: ParameterMetadata` and `Value: { "kind": 2, "version": 3 }`.
The following steps shows setting up the `disply_order` column.
Remark:
Step 23: Manually enter the information in the same manner as in Steps 16-1, 16-2, and 16-3.
Once all the above steps are completed, save the model and then refresh the semantic model within the workspace to apply the changes.
As shown in the model view of the semantic model, the new table has been successfully created.
To verify, check that the field parameter functions correctly in both the online report and the desktop version.
Online
Desktop
To summarize, I explored the process of creating a field parameter in Fabric's Direct Lake Mode Semantic Model using Tabular Editor 3. I detailed the steps to configure and rename columns, and provided specific steps for setting up the `display_name` column, 'field_name' column, 'display_order' column, and other parameters.
From here, I have learned how to:
1. Create and Configure Field Parameters: Understand the detailed process of setting up field parameters in a Direct Lake Mode Semantic Model, including the nuances of using DAX code and the Tabular Editor 3 tool.
2. Rename and configure Columns Effectively: Follow precise steps for renaming columns and setting options to ensure proper functionality within the semantic model.
3. Verify Model Changes: Check that field parameters and other model changes work correctly both in the online report and the desktop version.
By learning these steps, I can enhance my ability to develop and manage complex semantic models in Fabric, leading to more robust and flexible data insights.
Comentarios