I recently used this article, to dynamically change information within a slicer. Pretty cool!
However, I was curious if there was any tutorial for a slicer to select either the top or the bottom 5 with a [Value].
I was thinking of using a RANKX function while somehow making the DESC or ASC variables.
Is this feasible with DAX?
Solved! Go to Solution.
Yes, it is possible. For detailed information, you can refer to below steps:
1. Add a column to calculate the rank.
Rank = RANKX(ALL('Table'),[Amount],,DESC,Skip)
2. Calculate the top/bottom based on rank.
Top/Bottom = IF([Rank]<=5,"Bottom 5",if([Rank]>=MAX([Rank])-5,"Top 5","Other"))
3. Use the Top/Bottom column as the source of slicer.
BTW, the visual level filter also contains topn function.
I am unable to work this solution unfortunately, as I am calculating on my [Value] on a Calculated Measure.
For context, the measure's are essentially a continuation of these demo measures.
I looked into this, as a potential solution, but I wasn't seeing a proper output either.
Many thanks for your assistance Xiaoxin Sheng.
All my best,
All my formula are works on calculated column. Can you please share some sample data to test ?
For Velarde's solution, it seems like use measure to calculate rank, then use slicer to ensure the sort mode(ASC or DESC), finally use visual level filter to filter the rank range.