Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am trying to make a sliding slicer off of this measure. I found this code from another user that, gives the TOPN for using COUNTROW to get the TOPN of the most repeated values.
Measure = VAR __topn = TOPN ( 5, VALUES ( Table[Category Level 1] ), RANKX ( ALL ( Table[Category Level 1] ), COUNTROWS ( Table ),, ASC ) ) RETURN CALCULATE ( COUNTROWS ( Table ), __topn )
My is slicer is called "TOPN" and it can be slid from 0-20, where the number it is on should be the number of top values shown.
Solved! Go to Solution.
Hi @TSki ,
Unfortunately, you can't add measure to slicer. As an alternative, you can create a new column:
TOPN = RANKX('Table',[The most repeated values],,DESC,Dense)
I think this is pretty close to what you want:
Or like this:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @TSki ,
Unfortunately, you can't add measure to slicer. As an alternative, you can create a new column:
TOPN = RANKX('Table',[The most repeated values],,DESC,Dense)
I think this is pretty close to what you want:
Or like this:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @TSki ,
Do you want to count the number of the most most repeated values and then use it as slicer? If so, please try following steps.
This is my test table:
Create a new column instead of a measure:
The most repeated values = CALCULATE(COUNT('Table'[Category Level 1]),FILTER('Table','Table'[Category Level 1] = EARLIER('Table'[Category Level 1])))
Create a slicer using the column just created:
If I misunderstand your demands, please feel free to contact us in time.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for your reply @v-yadongf-msft ,
With this new column, can I apply a TOPN measure to it and then apply to a slicer? Where a one on the slicer displays the most repeated value, 2 shows the top 2 most repeated values, and so on. So in your test data, when the slicer is slid to 1: B will be displayed and when slid 2: B and D are displayed, when on 3: B, D, E, A are displayed and on 4: B, D, E, A, C are displayed.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
27 | |
24 | |
14 | |
9 |
User | Count |
---|---|
77 | |
61 | |
47 | |
17 | |
12 |