Forum Discussion
sarjensystems1
Helper III
6 years agoDynamic Top N with hirarchy in matrix Visual
Hii i have a requirement to display dynamic Top N category based on country and i am using Matrix visual i am using this DAX function TopN Sales= VAR SelectedTop = SELECTEDVALUE('TopN'[...
- 6 years ago
Hi sarjensystems1 ,
I have changed your measure and I guess this time it will satisfy your need:
TopN Sales = VAR SelectedTop = SELECTEDVALUE('TopN'[TopN]) RETURN SWITCH(TRUE(), SelectedTop = 0, [sales], RANKX ( ALL('Table'), [sales] ) <= SelectedTop, [sales] )And you will see:
For the related .pbix file,pls click here.
Best Regards,
Kelly
amitchandak
Super User
6 years agoI did not test it but
You might have to try ALLEXCEPT( Query1[Category]) in place of ALL( Query1[Category]).
Refer
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures