Forum Discussion

Arnault_'s avatar
Arnault_
Icon for Resolver III rankResolver III
9 years ago

Rank without repetitive rank

Dear All,

 

I'm quite unexperienced with Power BI but I am learning thanks to the great support of this forum. Now,

I have a simple question illustrated in the above figure. 

 

I have created a calculated column to get the rank ("Rang" in french) of the items listed in the first column based on their sales ("LCC_TOT_2").

 

Here is my formula :

RANG = RANKX('SEGMENTATION _DB';'SEGMENTATION _DB'[LCC_TOT_2];;DESC;Skip)

The problem is that I would like to get a unique rank and avoid as shown in the example below to have to times the same rank value (e.g. Rank "9"). I know this is because I have the same amount of sales, but anyway is there any solution to avoid repetitive rank.

 

Thanks in advance

 

 

5 Replies

  • Hi, Instead of SKIP in the last input of the RANKX function, type DENSE.

     

    Hope this helps.

    • Arnault_'s avatar
      Arnault_
      Icon for Resolver III rankResolver III

      Hi, thanks for your help, I have tried both and it doesn't change the result. I still have the same problem.

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

         

        Share the link from where i can download the .pbix file.

  • Eric_Zhang's avatar
    Eric_Zhang
    Icon for Microsoft Employee rankMicrosoft Employee

    Arnault_ wrote:

    Dear All,

     

    I'm quite unexperienced with Power BI but I am learning thanks to the great support of this forum. Now,

    I have a simple question illustrated in the above figure. 

     

    I have created a calculated column to get the rank ("Rang" in french) of the items listed in the first column based on their sales ("LCC_TOT_2").

     

    Here is my formula :

    RANG = RANKX('SEGMENTATION _DB';'SEGMENTATION _DB'[LCC_TOT_2];;DESC;Skip)

    The problem is that I would like to get a unique rank and avoid as shown in the example below to have to times the same rank value (e.g. Rank "9"). I know this is because I have the same amount of sales, but anyway is there any solution to avoid repetitive rank.

     

    Thanks in advance

     

     


    Arnault_

    That's the way how rankx works, to get the expected output, in QueryEditor, sort by LCC_TOT_2 ascending and add index column.

    • Arnault_'s avatar
      Arnault_
      Icon for Resolver III rankResolver III

      Eric_Zhang

       

      Thank you Eric for your answer.

      I do not see this option for a calculated table. When I go to the Query editor, this table does not appear. Otherwise, I do understand your proposition and it seems to be working fine for other tables. Cheers