Field parameters are another tool for Power BI developers to make their reports more dynamic and interactive.
They are currently a preview feature as of writing this blogpost, meaning you will need to enable it in the preview settings and I will show you how to do this further on in the blog.

 

What Are Field Parameters?

Field parameters enable report readers to switch between different fields or measures in a visual with just a click. This allows for a more flexible analysis, as users can dynamically switch the perspective of data without needing to create multiple visuals.

Under the hood, when you create a Field Parameter, it essentially creates a new table in your Power BI reports Semantic Model that consists of three columns:

  • The name of the column you used as a STRING
  • The reference to the column or measure
  • An order column

In my example, I have taken a field from the ‘Production Product’ table, a measure from the ‘Production Product’ table and a field from the ‘Production ProductCategory’ table.
This shows that you can add a mixture of fields and measures, even ones that come from another table.

The field parameter table looks like this:

 

The code behind the field parameter table looks like this:

Field Parameter = {

("Class", NAMEOF('Production Product'[Class]), 0),

("SUM of Standard Cost", NAMEOF('Production Product'[SUM of Standard Cost]), 1),

("Name", NAMEOF('Production ProductCategory'[Name]), 2)

}

 

You can then drag the field parameter you created into a slicer visual and allow your users to switch between fields and measures easily

 

How to Create a Field Parameter

Creating field parameters in Power BI is surprisingly simple:

  1. Enable the Feature: First, ensure that the field parameters feature is enabled. Go to File > Options and settings > Options > Preview features and select Field parameters.
  2. Create a New Parameter: Navigate to the Modelling tab in the ribbon and select New parameter > Fields.
  3. Select Fields: In the dialog box, provide a name for your parameter and select the fields you want to include. You can mix and match measures and dimensions.
  4. Customize Order: Drag to change the order of the fields or double-click any field to change its display name.
  5. Use in Visuals: Once created, you can use the field parameter in the field drop zones for a visual. This allows you to control the measures or dimensions used in a visual dynamically.

Practical Example

Example: Switching Dimensions on a Chart

Imagine you have a sales report where you want to analyse sales by different dimensions such as ProductCategory, and Region. By creating a field parameter, you can allow users to switch between these dimensions on a single chart, making the report more interactive and insightful.

 

Limitations of Field Parameters

So we’ve looked at how useful field parameters can be but there must be some limitations, right?

Well there is…

These limitations are taken from the Microsoft learn page and are accurate to my experience using field parameters:

Note: These limitations could change in the future however due to field parameters still being in preview

 

  • AI visuals and Q&A aren’t supported with the feature.
  • There’s no way for your 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.
  • You can’t create parameters in live connection data sources without a local model. However, if you use DirectQuery for Power BI semantic models and Analysis Services, you can add a local model to create field parameters. For more information about using DirectQuery for live connections.
  • You can’t use implicit measures, so if you need an aggregated column as one of your fields, you need to create an explicit DAX measure for it.
  • You can’t use field parameters as the linked fields of a drill-through or tooltip page. The workaround is to use the individual fields referenced within the field parameter instead. For example, if your field parameter includes Customer and Product fields, you can link these two fields to your drill-through or tooltip page so that visuals with the field parameter can launch your drill-through or tooltip page.
  • When a Field Parameter is used to swap fields in a Visual, the Visual drop some related information like Sort direction and Drill/Expand state.

 

In my experience the biggest limitation has been not being able to create field parameters in conjunction to a live connection data source, forcing you into a composite model consisting of imported tables and DirectQuery tables leading to performance issues.

This issue is very noticeable when you have a lot of Analysis Services cubes that you have to live connect to.

Hopefully you now have a better understanding of field parameters and know if they are worth while to incorporate into your solution!

Tags: ,