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.
Anonymous , top two categories per date based on?
Do need measure rank or column rank can do?
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
- Anonymous4 years agoNot applicable
amitchandak - Amit I need the top two categories based on date only.
For that, I need a RANK measure.- amitchandak4 years ago
Super User
Anonymous , Create a measure like this and use that in the visual level filter to check <=2
countx(filter(allselected(Table), Table[Category] = max(Table[Category]) && Table[Date] <= max(Table[Date])),Table[Date])