Forum Discussion
Issue with RANKX function with "Don't Summarize" option
- 4 years ago
Hi, Anonymous
Create a measure 'Rank' as below, then sort by column rank:
Rank = RANKX ( GROUPBY ( ALLSELECTED ( 'TestData' ), TestData[Category], TestData[Date] ), RANKX ( ALLSELECTED ( TestData ), CALCULATE ( MAX ( TestData[Category] ) ), , ASC, DENSE ) + RANKX ( GROUPBY ( ALLSELECTED ( 'TestData' ), TestData[Category], TestData[Date] ), CALCULATE ( MAX ( 'TestData'[Date] ) ), , ASC, DENSE ) / CALCULATE ( COUNTROWS ( 'TestData' ), ALLSELECTED () ), , ASC, DENSE )Please check my sample file for more details. If it doesn't work, share a pbix file on cloud storage for further research.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak - Amit Thanks for your help. As of now, it's working for me. Along with this, I want to sort one of the columns based on another column before giving the rank. Can you help me in that?
Anonymous , You can sort column on the column, but not a column on measure or measure on measure
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
- Anonymous4 years agoNot applicable
amitchandak - I have gone through this article as well before but in my case, I need to sort a column within a category as I was trying to get the rank within categories.