Forum Discussion
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
- Ashish_Mathur
Super User
Hi, Instead of SKIP in the last input of the RANKX function, type DENSE.
Hope this helps.
- Arnault_
Resolver 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
Super User
Hi,
Share the link from where i can download the .pbix file.
- Eric_Zhang
Microsoft 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
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_
Resolver III
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