Forum Discussion
RANKX ISSUE
Hi,
I have created RANKX as below using the measure and it did work. But when I added a new cloumn to the table RANK will change and nlt giving the correct information,
This is the formula I used and table work perfectly with thses columns.
But when I add another column it will give me below table,
I need to add more colums for this and I need help to setup the Rank according to my SUM value.
Can anyone help me with this.
Thank you.
- Anonymous5 years ago
Hi cham ,
Based on my test, you may modify the [SUM] measure firstly using the following formula:
SUM = CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[name]))And then use the RANK function:
Rank = RANKX(ALL('Table'),[SUM],,DESC,Dense)The final output would be correct:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- amitchandakSuper User
cham , Rank is context-specific , so you have two try one of the two ways
Rankx(all(Table2[Name], Table2[ID]), [sum])
or
Rankx(all(Table2), [sum])
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures- chamPost Patron
Hi amitchandak
Thank you so much for your help.
But When I use below its still having the same record twice. I used Skip function to solve that but its till giving me two records with same rank.
TEST = RANKX(ALL(Client),[SUM],,DESC,Skip)Thanks,C
- AnonymousNot applicable
Hi cham ,
Based on my test, you may modify the [SUM] measure firstly using the following formula:
SUM = CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[name]))And then use the RANK function:
Rank = RANKX(ALL('Table'),[SUM],,DESC,Dense)The final output would be correct:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.