Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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?
Many thanks!
Solved! Go to Solution.
Hi Xioxin Sheng,
Thanks for the help!
I was able to figure it out here!
https://community.powerbi.com/t5/Data-Stories-Gallery/Executive-Insights-by-Decisive-Data/m-p/181742
Best,
Jake
Hi @jolsby,
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.
Regards,
Xiaoxin Sheng
Hi @v-shex-msft,
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,
Jolsby
Hi @jolsby,
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.
Regards,
Xiaoxin Sheng
Hi Xioxin Sheng,
Thanks for the help!
I was able to figure it out here!
https://community.powerbi.com/t5/Data-Stories-Gallery/Executive-Insights-by-Decisive-Data/m-p/181742
Best,
Jake
See if this gets you closer:
https://powerpivotpro.com/2014/11/displaying-top-n-bottom-n-and-all-others/
User | Count |
---|---|
128 | |
108 | |
100 | |
64 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |