Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Greetings,
I have seen several examples with a dynamic top N but I just can't seem to get it working in my report.
Could someone have a look at my example ?
I have created below table for selection -
Based on below chart I want to give top n selection.
In the place of Axisi kept Business process type and in the place of value I kept parameter, the measure i have created i.e.
I know i am missingout something in my dax that y the slicer is not working.
Can anyone help me with this?
Thank you in advance!
Solved! Go to Solution.
@Anonymous , Assume you have measure on which you want rank
measure =CALCULATE(COUNT(Sheet1[Business_Process_Type]),filter(Sheet1,Sheet1[Category]=1))
Rank you want
rank = rankx(allselected(Sheet1[Business_Process_Type]) ,[measure] )
filter on Rank
Rank Top N= CALCULATE(if([Rank]<=SELECTEDVALUE(Slider_BP[Value]),[measure],BLANK()) ,VALUES(sheet1[Business_Process_Type]))
using TOPN
Top N = CALCULATE([measure],TOPN(10,all(sheet1[Business_Process_Type]),[measure],DESC),VALUES(sheet1[Business_Process_Type]))
@Anonymous , change this statement and try
CALCULATE(COUNT(Sheet1[Business_Process_Type]),filter(Sheet1,Sheet1[Category]=1))
if not share your TOPN code
@amitchandak, I tried to write below formula as per the post that you referred. Could you please rectify my dax?
@Anonymous , I think the Rank is not used correctly.
Can you paste the formula in text format
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
@Anonymous , Assume you have measure on which you want rank
measure =CALCULATE(COUNT(Sheet1[Business_Process_Type]),filter(Sheet1,Sheet1[Category]=1))
Rank you want
rank = rankx(allselected(Sheet1[Business_Process_Type]) ,[measure] )
filter on Rank
Rank Top N= CALCULATE(if([Rank]<=SELECTEDVALUE(Slider_BP[Value]),[measure],BLANK()) ,VALUES(sheet1[Business_Process_Type]))
using TOPN
Top N = CALCULATE([measure],TOPN(10,all(sheet1[Business_Process_Type]),[measure],DESC),VALUES(sheet1[Business_Process_Type]))
@Anonymous , refer to this blog
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 22 | |
| 22 | |
| 18 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 63 | |
| 50 | |
| 46 | |
| 41 | |
| 39 |