What are Field Parameters in Power BI?

In the May 2022 version of Power BI Desktop, Microsoft released Field Parameters as a preview feature. Field Parameters allow users to toggle between dimensions and measures with the click of a button rather than some of the more complicated workarounds needed in the past. Field Parameters will help shorten development time for Power BI reports and provide enhanced flexibility for both developers and report viewers. 

In this blog post, I will walk you through what Field Parameters are, why they are important, and how to use them in an example use case. By the end of this blog, you should have a decent working knowledge of how to use Field Parameters in your Power BI reports!

What are Field Parameters?

Field Parameters are a feature that allows users to toggle between various fields or measures within a data model. The implementation of Field Parameters is very similar to the old What-If Parameters (now called Numeric Range Parameters.) Instead of just being able to toggle a value, now you can toggle between fields. 

The Field Parameters you create add a new table to your data model and allow you to control the values in that table via a slicer. The default Parameter Field created in your table can be used throughout your report where you want the ability to change the field or measure instantly. 

Why are Field Parameters Important?

Field Parameters are an important release for two main reasons: 

  1. They provide end-users instant flexibility in their data exploration and analysis 
  2. They are further proof that Microsoft is investing in providing a better user experience for Power BI consumers rather than just investing in backend features. 

Tools such as Tableau have had this feature for quite some time, so hopefully, this can help Power BI catch up in one of the main areas that it lags, which is the flexibility and customization of your user experience. The same functionality was achievable using the SWITCH() DAX function, but that took both additional time and expertise. The new Field Parameters feature does not require much time or expertise to implement. 

How to Use Field Parameters

Now that we know what Field Parameters are and why they are important, let’s run through how to use them in Power BI.

Step 1: Enable Field Parameter in Preview Features

To kick off your understanding of Field Parameters, you must make sure that the preview feature is enabled since it is not a native feature just yet (as of May 2022 release).

To enable, click on File in your top left and select Options and Settings. Next, click Options, which will bring up an Options box. You can find the Preview features selection near the bottom (see image below).

the options window in Power BI for field parameter navigation

You can see that I have checked the box for Field Parameters. Once you have done this, you will need to restart your Power BI Desktop instance to gain this functionality. 

Step 2: Create a Field Parameter

Now that you’ve enabled the feature, let’s create a Field Parameter to practice.

Navigate to the Modeling ribbon at the top of your Power BI Desktop screen. You will see a drop-down button in the Parameters section where there used to be a section called ‘What if.’

The new interface has two selection options: Numeric range and Fields. The Numeric range option is very similar to the old What-If Parameter, allowing you to specify a number within a given range. The Fields option is now enabled.

navigating to create a new parameter in Power BI using the New parameter button under modeling

Click on the Fields option so we can create our parameter. The Fields option is selected, but you can toggle this to the Numeric range if needed. 

Then, place the name of the parameter you’re creating in the text box labeled Name. 

Lastly, select the fields you want to be included in the parameter by checking the box or dragging them to the box on the left. Drag the fields to the desired order as they will show in this same order in the slicer when you place it on your report canvas. 

reordering fields in Power BI parameters window

Creating a new Field Parameter will add a new table to your fields pane on the right side of your Power BI Desktop. See the example below where we have named this table Row, as it will be toggling what rows we see in a table view. 

naming a table "Row" for toggling rows in a table view

The DAX syntax for creating this Field Parameter that includes six different fields is shown below. You can also see the order of the fields in the right portion of the syntax and change the order of the sorting in this syntax if you want as well. 

DAX Syntax for creating field parameters in Power BI

Note: if you make the sort numbers all the same number (ex. All show 1), then the sort will default to the alphabetical order of the field name. 

Field Parameter Example Use Case

Now that you’ve created the parameter, let’s go ahead and use it in an example. 

Click on the slicer visual in your visualizations pane and add the newly created Parameter field into the Values. This should populate the slicer with the fields you chose while creating the Field Parameter. 

In my example, I will create a table visual that shows Sales, Profit, and Profit Margin by either Category or Sub-Category, depending on which one is shown. The two school shots below show you how selecting the different values in the slicer toggle the table views. 

category toggle for a table visual in Power BI
a table showing subcategories, sales, profit and percent margin in Power BI

Although this is a table visual, you can also use this technique to toggle between fields in other types of visuals. 

Closing

I hope you found this blog useful in understanding the new Field Parameters feature for Power BI Desktop. 

This new feature should help make toggling fields much easier for both the developers and end-users. Feature improvements like this are a good sign that Microsoft is invested in making Power BI’s user experience better for all. 

If you want any more information about Field Parameters or help implementing them in your current reporting, reach out to our team of Power BI experts to help! 

FAQs

You can include measures in your parameter field as well. To get the best result, you should define the aggregation in a measure before including it in the parameter. If you just include an integer field, it will read like a text instead of automatically aggregating. 

The most common use case we’ve found is when users want to see the same views of multiple metrics. You can create multiple tabs or bookmarks, but neither is as efficient as creating a parameter. Another use case where you might want to toggle instead of adding new visuals to your canvas is when viewing the report via the mobile app. 

Accelerate and automate your data projects with the phData Toolkit

Data Coach is our premium analytics training program with one-on-one coaching from renowned experts.