Field Parameters in Power BI

Field parameters allow users to dynamically change the measures or dimensions being analyzed within a report. This feature can help our report readers explore and customize the analysis of the report by selecting the different measures or dimensions they're interested in.

Enable the field parameters To get started, we first need to enable the Field parameters feature.
Step 1: In Power BI Desktop, go to File >Options and settings >Options > Preview features.
Step 2: Select the Field parameters.

Field Parameters in Power BI

Use case 1: Change the Dimensions Let’s create a field parameter which changes the dimension in the visual.
Step 1: To create a new field parameter, go to the Modeling tab in Power BI Desktop and select “New parameter” and then select “Fields”.

Field Parameters in Power BI

Step 2: To build the parameter, provide a name for the parameter and select the fields from the table we want to use.

Field Parameters in Power BI

In this example, we have selected the fields: 10th Marks, and 12th Marks from the Sheet1 table. Check the checkbox “Add slicer to this page” to automatically add the slicer with the fields on the report page.

Field Parameters in Power BI

In this dialog, we can drag to change the order of the fields or double-click any of the selected fields to change the display name.

We can also mix and match measures and dimensions within the same parameter. For example, we can use this feature to create a dynamic table, where the columns can be either measures or dimensions.

After clicking on Create, the slicer is added on the page with the fields selected at the time of creating the parameter and a table is created with the name of the parameter.

Field Parameters in Power BI

Step 3: Use a field parameter to control visual properties Once we have created a field parameter, we can use the parameter to control the measures or dimensions used in a visual.

Add a table visual and drop the fields Name and the My First Parameter in the fields zone.

Field Parameters in Power BI

Note: We can see now that in the slicer no value is selected it specifies that all values are selected in the slicer. There’s no way for our report users to select the "none" or no fields option. Selecting no fields in the slicer or filter card is the same as selecting all fields.

Select 10th Marks value from the slicer. Now in the table visual from the parameter only the 10th Marks field is selected to show, as shown in the image below:

Field Parameters in Power BI

We can also make the slicer to single select, so only field is active at a time.

Field Parameters in Power BI