Forum Discussion
Dynamic Top N
- 5 years ago
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]))
amitchandak , tried but did not work.
- amitchandak5 years agoSuper User
Anonymous , change this statement and try
CALCULATE(COUNT(Sheet1[Business_Process_Type]),filter(Sheet1,Sheet1[Category]=1))
if not share your TOPN code
- Anonymous5 years agoNot applicable
amitchandak, I tried to write below formula as per the post that you referred. Could you please rectify my dax?
- amitchandak5 years agoSuper User
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