Forum Discussion
Top 10,20,30 Values using Dynamic Slicer
- Anonymous5 years ago
Hi Ashish_kumar12 ,
Here are the steps you can follow:
1. Create a table.
2. Create measure.
Measure_rank = RANKX(ALLSELECTED('Table'),CALCULATE(SUM('Table'[Revenue])),,DESC)Measure_flag = var _top=SELECTEDVALUE(Slice[Top]) return IF([Measure_rank]<=_top,1,0)3. Set Sort by-[ Measure_rank] and Sort ascending.
4. Take the [Top] column of the Slice table as the slicer, put measure[Measure_flag] into the Filter, and set is=1, apply filter.
5. Result.
When 10 is selected, the top 10 data will be displayed:
When 20 is selected, the top 20 data will be displayed:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Ashish_kumar12 ,
Here are the steps you can follow:
1. Create a table.
2. Create measure.
Measure_rank =
RANKX(ALLSELECTED('Table'),CALCULATE(SUM('Table'[Revenue])),,DESC)Measure_flag =
var _top=SELECTEDVALUE(Slice[Top])
return
IF([Measure_rank]<=_top,1,0)
3. Set Sort by-[ Measure_rank] and Sort ascending.
4. Take the [Top] column of the Slice table as the slicer, put measure[Measure_flag] into the Filter, and set is=1, apply filter.
5. Result.
When 10 is selected, the top 10 data will be displayed:
When 20 is selected, the top 20 data will be displayed:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Harika058 months agoHelper I
A small query - I have tried to apply this solution,my dimension is a field parameter with 4 columns coming from table 'Facts' ,I when I apply the same logic its not giving correct results .
Measure_Rank=RANKX(ALLSELECTED('Facts'),abs([CM]-[LM]),,DESC) anything to do differently?