Forum Discussion
Dynamic ranking based on slicer selection
Hi All -- Need one help with dynamic ranking based on slicer selection. Link has the PBIX file along with data. What I am trying to see is based on my year / month / quarter selection it should give correct ranking in the table like 1,2,3 ...
Hi,
It works fine. See the highlighted portion in the image
11 Replies
- Ashish_Mathur
Super User
Hi,
It works fine. See the highlighted portion in the image
- AnonymousNot applicable
Thank you. That helped
- Ashish_Mathur
Super User
You are welcome.
- rishikhuranaRegular Visitor
Hi Ashish,
Solution is great however, I have a quick question related to this if you can please answer?
I am making a selection through Slicer/Filters where in the background data I have 42 distinct rows. When I create this rank formula, it assigns rank to all 42 but doesnt change (reduce) if i filter few through selection. Like I am making a selection that results in 8 data points, the column technically assign rank till 8 and not all 42 correct?
Please help?
Thanks
- Ashish_Mathur
Super User
Thank you. That is an sold post. Please describe your question, share some data and show the expected result.
- smpa01
Community Champion
Anonymous please try this and test the output
Measure 6 = RANKX ( CALCULATETABLE ( VALUES ( Sale[Sales Person] ), FILTER ( ALLSELECTED ( Sale ), Sale[Date].[Year] = SELECTEDVALUE ( Sale[Date].[Year] ) ) ), CALCULATE ( DIVIDE ( CALCULATE ( SUM ( Sale[Sales] ) ), CALCULATE ( SUM ( Sale[Target] ) ) ) ), , DESC, DENSE )Big thanks to Zubair_Muhammad