Forum Discussion
Rank with the same numbers
Hello! i'm having some problems whit the function RANKX.
What can i do if i have the same amount in different categories and i want to do a rank? i want to see only the top 5, but the rank 5 is 11 times, so how can i choose some of them?
Example:
Thanx!
9 Replies
- Greg_DecklerCommunity Champion
Try specifying Dense as an option, the default is Skip.
https://msdn.microsoft.com/en-us/query-bi/dax/rankx-function-dax
- PaulaHelper I
Hi Greg_Deckler
i'm using Dense, but the rank is the same when i have the same amount for different categories.
- Greg_DecklerCommunity Champion
OK, so my understanding is that you want the top 5 categories. But, some of the categories have the same amount that you are ranking on. I guess my question is, how do you want it to work? In your scenario where you have a bunch of ranking "5", do you want it to randomly pick one? What is your expectation?
- v-jiascu-msftMicrosoft Employee
Hi Paula,
Which some of them do you want? Are there any other conditions? If it's possible to sort Amount in the Query Editor and add an index?
Best Regards,
Dale
- PaulaHelper I
I have no preference. If I add an index, can I choose one of the categories and obtain the top 5? In case of adding an index, what would the DAX be like?
There is no other condition.