Forum Discussion

mturcotte_epq's avatar
mturcotte_epq
Advocate I
6 years ago

RANKX Problem

I have been using the following formula with RANKX successfully with various tables, but I'm running into an issues where different values get the same rank with the following report:

 

G - Rank =
VAR temp = SUM ( RANKX_Problem[G] )
RETURN
   IF (
       temp = 0;
       BLANK ();
       RANKX (
                    ALLSELECTED ( RANKX_Problem );
                    CALCULATE (
                                         SUM ( RANKX_Problem[G] )
                                        );
                    ;
                    ;
                    Dense
       )
   )

 

 

Notice 201706 has value G=62 and gets RANK 1 correctly, but so does 201702 with G=44

 

Any help appreciated!

 

Thanks,

 

MT

5 Replies

  • kentyler's avatar
    kentyler
    Solution Sage

    You have 11 different  values, but the measure only returns ranks of 1 to 3. What is your intention ?

    • mturcotte_epq's avatar
      mturcotte_epq
      Advocate I

      I'm sorry, I thought my intention was obvious...

       

      I would like "G - Rank" to contain the ranks from 1 to 11 based on the values of G.

       

      So G=62 would have G-Rank=1

      G=44 would have G-Rank=2

      G=37 would have G-Rank=3

      ...

       

      Thanks, MT

       

  • v-eachen-msft's avatar
    v-eachen-msft
    Community Support

    Hi mturcotte_epq ,

     

    I created a similar file as yours but I don't have these issues. You could get slicer by creating an independent table. Could you share your files?