Skip to main content

Field Parameters in Power BI

Have you worked with field parameters? Another functionality that Power BI offers is to improve your reports. What does it do for the users? At first, it looks like a button but it helps to toggle between different fields (can be columns or measures). Let's get our hands dirty and start with an example.

I am using sample superstore data. The idea is to make a clustered bar chart with profit and sales in it. On the Y axis, I need both category and subcategory. The basic approach will be just to add another level to the Y axis which will act as a drill down. But what if I say you don't need a drill down. Yes, that's possible with the use of field parameters.

Let's create one!! Go to the new parameter under modeling. Select the field parameter from there you will get a pop-up window that looks something like this. You can name your parameter and just drag the fields from the respective tables. I need only category and sub-category.

Pro tip- If you can't find the field parameter you need to go to the option and settings. In the preview feature, you need to enable the field parameter.


Once you click OK it will create a slicer (default setting). I am selecting a slicer with tiles. My visual has this parameter (parameter 1) on the Y-axis. Sales and profit on the X axis. If you check the data model you can see the parameter there. Now you can easily toggle around between categories and sub-categories.

Now, what if you want to add another field to the parameter or you want to edit the name of the fields that are showcased in the tiles. To do so go to the fields section in the report under it you can see the parameters. If you select the parameter you can see the DAX behind it. You can easily add or replace fields.

Pro tip- A very basic thing when you are using field parameters. Be aware that don't mix measures and columns in it. For eg, in our case, we took categories and sub-categories which are columns. I can add more columns to it but adding a measure to it can give you strange results.

Let's take the field parameter to the next level. Currently, we only have category and sub-category but I also want to see overall total sales and profit. To do it we are creating a calculated column " None" which contains only text. Let's adjust the parameter accordingly.


Isn't it easy? It will add another tile in your slicer and when you click it it will show overall profit and sales.


Field parameters improve the quality of your report. I prefer to use them as slicers but you can play around with them. But make sure you don't use implicit measures in field parameters always go for explicit measures. To know more about implicit and explicit measures read our blog (link).


Thanks for Reading Let's connect on LinkedIn. For more such blogs and pro tips do follow us.




Comments

Popular posts from this blog

Identify and Delete Unused Columns & Measures

Heavy dashboards and a bad data model is a nightmare for every BI Developer. Heavy dashboards can be slow due to multiple reasons. It is always advised to stick with best practices. Are you still figuring out about those best practices then you should definitely have a quick read on Best Practice Analyser ( link ). One of the most common issues with slow dashboards is unused columns and unused measures.  It is very normal to load some extra columns and create some test measures in your dashboard but as a part of cleanup process those unused columns and unused measures should be removed. Why we are removing them? Because if you keep them then ultimately it will increase the size of your data model which is not a good practice.  How to identify the culprits (unused columns and unused measures)? In today's blog we will provide you with 2 most common external tools which will help you in identifying the culprits. More external tools😒. Who's going to pay for this? To your surprise...

Copying Bookmarks from one Power BI report to another

Let's think of a scenario, where you want to copy the bookmarks from one report to another. Most obvious approach is to just do a copy paste of the bookmarks. What's wrong with this approach? This approach only works for all visuals but not for bookmarks and field parameters.  If you are not familiar with basics of bookmarks and field parameters do refer to the beginners guide for bookmarks  and introduction to field parameters . Then how do you copy the bookmarks? Power BI enhanced report format (PBIR) for Power BI Project files (PBIP) will help you in achieving this. Let's check it out, I have 2 reports one contains the bookmark called Bookmarks PBIR Test (origin) and other one is Rolling Average PBIR Test (destination) .  Before we get started, you have to enable Power BI Project save option under preview features. Once enabled, restart Power BI desktop. There is a TMDL icon appearing on the left pane. What is TMDL and what's in it for me? There's a lot of possi...

Best Practice Analyser (BPA) Guide

Do you want to save tons of efforts to check if your data model and PBIX file follows the standard best practices and norms? Then this blog is for you. If you are a follower of our channel we already deep dive into the importance of the DAX Studio as an external tool. If you are a beginner I would highly recommend to visit this blog . In today's blog we will check how Tabular Editor can help to optimize the data model.  Best Practice Analyser allows to define or import best practices. It will make sure that we do not violate the best practices while developing a dashboard. Isn't it exciting!! Before we start make sure you already have Tabular Editor version 2.24.1 installed on your system. To install it do visit this link and select the link for windows installer. Once Tabular Editor is installed it will reflect in your PBIX file under external tool. Also, we need to define the standard rules. To do so in your advanced scripting or C# script copy this and save it via Ctrl+S. An...