Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I need help with a DAX formula.
For some reason, my ranking doesn't seem to work. I need to create a rank without repeated values, I'm currently using the following formula:
RankCOPQ = RANKX(ALLSELECTED('Table');CALCULATE(SUM(('Table'[Amount $])));;DESC;Dense)
But, for some reasons, different values have the same rank, as you can see in the pic below:
How can I solve this out? I've been trying to find fixes everywhere but I wasn't able to find someone that had the same problem that I have.
Thank you very much!
RankCOPQ = RANKX( ALLSELECTED('Table'[Amount $]); CALCULATE(MAX('Table'[Amount $])) ; ; DESC; Dense )
If you drop the "Amount $" column on a visual, only the distinct values from the column are displayed. If you use SUM(...) all the rows with the same value of "Amount $" will be summed up. This is not what you want. You want the value itself, hence MAX(...), which will return the value itself.
Best
Darek
Hi Darek,
Thank you very much. I appreciate the effort in helping me.
Thankfuly, the rank problem is solved, the thing is, the rank doesnt seem to work correctly, e.g.
The rank 4 should be the number one, since it represents the biggest value in amount $, so, what I'm doing wrong?
I'm deeply sorry for the lack of knowledge, i'm a total beginner in DAX.
You are simply not describing the problem correctly 🙂 My measure works correctly based on the assumptions I've made. But they are not what is true, hence the results.
You have to show the full report, not only the two columns as I suspect this is not what's in the visual. You don't rank the amounts themselves but something different. The amounts are most likely calculated for this "something different."
Please post the full story.
Best
Darek
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
46 | |
26 | |
22 | |
12 | |
8 |
User | Count |
---|---|
75 | |
50 | |
47 | |
16 | |
13 |