Forum Discussion
Rank based on category column
I have three columns Category , subcategory and Amount column.
I am adding category , subcategory and sum of amount column in table. I want to calculate rank (sum of amount column) based on only Category and should not change by addition of subcategory.
Sorry I think this measure should be helpful.
Rank = RANKX(ALLSELECTED('Table'[SubCat]),CALCULATE(SUM('Table'[Amount])))Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
9 Replies
- v-jingzhangCommunity Support
You can create a measure with below formula, then add it to the same table visual. This measure ranks Category based on Sum of Amount descendingly.
Rank = RANKX(ALLSELECTED('Table'),CALCULATE(SUM('Table'[Amount]),ALLEXCEPT('Table','Table'[Category])),,DESC,Dense)Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.- darshaningaleResolver II
For the data mentioned by you, the rank should be 1 for 100 , 2 for 30 ... Then again it should be 1 for 40 and 2 for 23. Then again it should be 1 for 93 and 2 for 80
- v-jingzhangCommunity Support
You can use this measure
Rank = RANKX(ALLEXCEPT('Table','Table'[Category]),CALCULATE(SUM('Table'[Amount])),,DESC,Dense)Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.