Sunday, June 13, 2021

Dynamic Filter Using Parameters in PowerBI

A parameter serves as a way to easily store and manage a value that can be reused.

Parameters give you the flexibility to dynamically change the output of your queries depending on their value.


#1 click "Transform data" on the Home Tab











↓ 












#2 Create a unique list of RegionName as an option to choose from when the report runs. For this, right-click the RegionName column header and select "Add a New Query"
















↓ 




















#3 Now we still don't have a unique list of values on our list query, so right-click the column header again to remove duplicates












↓ 



















#4 Now we have a unique list of RegionName, let's store this list in a form of a parameter. Click the Home tab, click "Manage Parameters"














↓ 

Click New















Note: "current value" is a default value.

Click OK












#5 The next thing we need to do is to apply a parameterized filter on the overview table so that the data loads only for the selected RegionName. To do this, click on the arrow icon on the RegionName column header, go to the "Text Filters",  and select "Equals"













↓ 

change the filter type to "parameter"















And select the parameter we just created

Click Ok, Click "Close&Apply"















Now we can only see the default value of RegionName we set up, which is the "Greater Manchester"


#6 The last thing we need to do is make this filter selection pop out to the users when they run this report. To do this, go to the File menu, click Save as, save the report with a name and change the type to Power Bi template files.
















Now we run this file, you will see the system is coming out with this list of RegionName to choose from, which is a part of the parameter we created.












Then choose the RegionName data you would like to see, now the reports show the analysis only for the selected RegionName.

No comments:

Post a Comment