Forum Discussion
Rankx not working in a table with multiple fields
Anonymous , Measure Rank is context-specific
Like this my city Rank
City Rank = RANKX(all(Geography[City]),[Sales])
In case add city Id, which keys for the city in visual. I will still get 1 . Because now city is getting ranked inside city id
Now this will allow me to handle above
City and ID Rank = RANKX(all(Geography[City],Geography[City Id]),[Sales])
As both city and City Id are the same levels I can also use the one below
Geography Rank = RANKX(all(Geography),[Sales])
Hope this will help
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415
Thanks a lot. This works