Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Dynamic parameters allow parameters in Power Bi to be bound to a column, in which any time the column is explicitly filtered by the user, the visuals on the page will be updated by reprocessing the queries using the paramter value(s) the user has selected.
As of the writing of this blog, the following limitation apply:
In this example, we will use Azure Data Explorer. In order to follow this example fully, you will need to have an Active Directory account (you can use a free outlook.com account).
Before we begin you must enable this feature in the preview settings:
Open Power Bi, and select Get Data, search for Azure Data Explorer (Kusto) and connect to it
Now put in the following details:
Cluster: help
Database: Samples
Query: StormEvents
Data Connectivity Mode: Direct Query
Sign in using any AD account:
Load in the data, and rename the query to StormEvents
In this step, we will leverage ADX's percentile function which is not avialable in Power Query.
Start by creating the Percentile parameter. Set it to required and set the type to Decimal number, with a current value of 50:
Create a new Blank query (right click and choose New source -> Blank Query)
Rename it to ADXQueryFormat
Open the Advanced Editor, and enter in the following query text:
"StormEvents
| summarize DamagePropertyPerc = percentile(DamageProperty, #{0}) by State"
If you plan on editing this later, use the Advanced editor to do so.
Here the #{0} is the place holder for our paramter.
Next, Create the query string for the actual ADX query using a Blank query with the following formual:
Text.Format(ADXQueryFormat, {Percentile})
This will be an actual query that gets sent to the server
Next, we just need to substitute the generated query with the "StormEvents" placeholder in our StormEvents query with ADXQuery
Next, we create a column which will contain all valid values.
Create a new Blank query called Percentiles with the formual:
= #table(type table [Percentile = number], {{50}, {75}, {90}, {96}})
Disable loading of the ADXQuery and ADXQueryFormat. This is done by right clicking a data source and unchecking Enable Load
Smash that Close And Load button, to create a direct query connection in your model.
Next in the left side tool bar click the bottom icon for Model.
In the fields view, expand Percentiles and select Percentile
In the properties tab, click Advanced, and in Bind to Paramter, select Percentile.
Also, turn off Is nullable.
Now for the east part, create a slicer for the percentiles:
Since we bound the parameter, and we put single select, the slicer will automatically be single select
Now simply add a table visual with the StormEvents fields (Remove the totals row, enabling that will not be covered here today).
Feel free to adjust the values as needed, add more visuals and try it out in your own dataset:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.