Field Parameters in Power BI

Slicers are great yeah! But with field parameters, you can do even more. Field Parameter enables a self-service BI experience for end users. It is a relatively new and highly effective feature in Power BI Desktop, released in May 2022. It allows the report developer as well as end-users switch the visual content without any hassle. In the past, we had to do this manually with tools like bookmarks, but since this feature was introduced, creating dynamic and user-friendly reports just got easier.

In this blog, we will learn how to set up field parameters in a visual, its benefits, explore some use cases, and also its limitations.

Steps to set up!

The field parameter feature can be found in the modeling tab as seen below. 

However, if you don’t see it, you can:

Go to File Ribbon >> Options and Settings >> Options >> Preview features.

Creating a Field Parameter

Creating a field parameter is quite easy. Navigate to the Modeling tab and from the New Parameter drop-down, choose field.

Clicking on the Fields option opens a dialogue box as seen below. You can choose the fields you want to slice by from the model and also drag to reorder. It is optional to give your parameter a name and then click on Create.

Once you create a field parameter, a slicer is automatically added to your report view. A calculated table will be automatically added to your data model as well.

By clicking on the parameter you just created, we can see the content of the table in a written DAX as seen below.

How to use field parameters

To see the field parameter, you just created in action, you’ll have to create a visual and then add the parameter into one of the fields as seen below.

Here, I created a bar chart with the region on the Y axis and the Amount field on the X axis. Adding the parameter to the Y-axis of the same chart brings the parameter to life. Now you can use the slicer to filter the chart as seen above. One interesting thing is that the title also changes appropriately as you filter the visual. If you wish, you can conditionally change the title of the visual by using a column in the parameter table.

How does the Field Parameter DAX work?

Once you create a field parameter you can no longer edit it within the User Interface. You can only edit the DAX to add or remove columns you want users to analyze.

Note that field parameters come as a calculated table with 3 columns.

The first column is the column name, the second is the field from the different tables in your model and the last one is the order i.e. the arrangement order of the fields in the slicer. “NAMEOF” is a new DAX function that returns the name of an object/column. The essence of this function is to make sure that the Expression still works even if you change the name of one of the columns. The Parameter order specifies the order in which you want your fields to appear.

 Additional Tip

You can also add a column to the DAX formula, this works like a matrix to summarize/categorize the fields of you. See the image below.

To add a column, ensure the column name is written in double quotes. Also, the column you have added will be given a header that can be renamed. Like in the picture above, it was renamed from Value4 to Category. This new column can be used to categorize your fields in the slicer, see image below. This gives your slicer a cleaner look especially if you have many fields in the slicer.

Limitations

·       Does not support Live connection data sources for now.

·       Implicit measures are not supported in field parameters.

·       They are not so intuitive to users/consumers, since it looks like the regular slicer, which can be a bit confusing.

·       AI and Q&A visuals do not support parameters yet.

Conclusion

Field Parameters lets you give your end-users the ability to change what measures they see in the visualization(s). It is an absolutely great feature that could come in handy to minimize the number of visuals you create in a report. However, it is important to be honest with yourself and know if it would meet the needs of your end-users, so you don’t just use it because it’s a cool feature. It has no place in a summary report, but when end-users prefer to have a deep-dive analysis of the report, you can introduce field parameters.

Previous
Previous

A Guide to Combine Data from Multiple Tables in SQL Using Joins

Next
Next

Introduction to AdventureWorks Database 2022: A Guide for Installation and Data Exploration