Forum Discussion
Issues with RANKX
- 5 years ago
Hi, Gombosf , you might want to try this measure
Rank = RANKX(ALLSELECTED(Table1[Name]), [Total_value])In fact, the mechanism of RANKX() under the hood is way much trickier than it appears. Here are some links for your further study if you're looking to master this most frequently-used function in DAX and to put it in your quiver.
https://docs.microsoft.com/en-us/dax/rankx-function-dax
https://www.sqlbi.com/articles/use-of-rankx-in-power-bi-measures/
- 5 years ago
Gombosf , Rank is context-sensitive. When you take the table the level of the table where it going to create rank from.
Try a measure like
Ranking_value = RANKX(ALLSelected(Table1[Name]), [Total_value])
refer: https://www.youtube.com/watch?v=DZb_6j6WuZ0
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
Hi, Gombosf , you might want to try this measure
Rank = RANKX(ALLSELECTED(Table1[Name]), [Total_value])
In fact, the mechanism of RANKX() under the hood is way much trickier than it appears. Here are some links for your further study if you're looking to master this most frequently-used function in DAX and to put it in your quiver.
https://docs.microsoft.com/en-us/dax/rankx-function-dax
https://www.sqlbi.com/articles/use-of-rankx-in-power-bi-measures/