Forum Discussion

cham's avatar
cham
Post Patron
5 years ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    5 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

    • cham's avatar
      cham
      Post 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
  • Anonymous's avatar
    Anonymous
    Not 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.