Forum Discussion
Rank dynamically the data displayed in a table based on the sorted data in the table visual
- 6 years ago
Hi natabird3 ,
Sorting multiple columns using the RANK () function?
Like this?
//column Rank = RANKX( FILTER( Sheet7, Sheet7[Country] = EARLIER(Sheet7[Country]) ), Sheet7[Cost (EUR).2], , ASC, Dense )Or like this?
//Column Rank(1) = RANKX( Sheet7, [Sum(cost)], ,ASC,Dense )If these are not correct, Please give us an output table (made in Excel) and indicate whether each column is roriginal data or comes from a DAX formula?
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
can you please try the below measure to get
Sales_Rank= RANKX(ALL(test[name]),[sales],,DESC,Dense)
- natabird36 years ago
Skilled Sharer
Hello,
Thanks for the reply. Unforutantely, i have already tried a few of these rankx options but the desired result is not coming. Jut so i understand the "test name" is the dimension that i am trying to use, so like country for instance, and the [sales] is the value that i want to rank, which is a measure say sum of sales. I put all that in a measure and all i get is 1 and 2 for most values but not an accuarate ranking at all. Any idea why is that happening? Thanks in advance for the help.
- v-lionel-msft6 years ago
Community Support
Hi natabird3 ,
Sorting multiple columns using the RANK () function?
Like this?
//column Rank = RANKX( FILTER( Sheet7, Sheet7[Country] = EARLIER(Sheet7[Country]) ), Sheet7[Cost (EUR).2], , ASC, Dense )Or like this?
//Column Rank(1) = RANKX( Sheet7, [Sum(cost)], ,ASC,Dense )If these are not correct, Please give us an output table (made in Excel) and indicate whether each column is roriginal data or comes from a DAX formula?
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.