Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a seemingly simple problem that I can't seem to solve. I want to add an index measure to a matrix.
To simplify, my data looks like this:
id | Minutes |
A | 10 |
A | 15 |
A | 20 |
B | 5 |
B | 15 |
and I have a matrix filtered by id=A with only the minutes column.
I have created a measure :
But I would like to have the reverse order, but change DESC to ASC, I obtain :
Do you know how to calculate this rank correctly?
Thanks
Solved! Go to Solution.
Hi, @Jeremy19
The main reason why you get wrong sorting result under ASC sorting is that the current rank is also affected by id=B, e.g. 10 should correspond to a rank of 1.
You should change your DAX expression to look like this:
Rank = RANKX(ALLSELECTED('Feuil1'),[Mesure],,DESC)
The DAX used in my tests is as follows:
rank =
RANKX(ALLSELECTED('Table'),[Measure],,ASC,Dense)
This DAX does a good job of returning the correct ranking results:
Best Regards,
hackcrr
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Jeremy19
The main reason why you get wrong sorting result under ASC sorting is that the current rank is also affected by id=B, e.g. 10 should correspond to a rank of 1.
You should change your DAX expression to look like this:
Rank = RANKX(ALLSELECTED('Feuil1'),[Mesure],,DESC)
The DAX used in my tests is as follows:
rank =
RANKX(ALLSELECTED('Table'),[Measure],,ASC,Dense)
This DAX does a good job of returning the correct ranking results:
Best Regards,
hackcrr
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Jeremy19
i have used this measure:
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: www.youtube.com/@Howtosolveprobem
Regards
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |