Forum Discussion
HarishMJ
1 year agoRegular Visitor
Ranking not working as expected
Hi everyone, I’m facing an issue with the RANKX DAX formula and would greatly appreciate your help! Here’s the scenario: I have created the following RANKX measure, which works perfectly in a t...
- 1 year ago
measure:
RankX =
IF (
ISFILTERED ( Sheet1[CIF] ) || ISFILTERED ( Sheet1 ),
RANKX (
ALLSELECTED ( Sheet1[CIF] ),
CALCULATE ( SUM ( Sheet1[Amount] ) ),
,
DESC,
DENSE
),
RANKX (
ALL ( Sheet1[CIF] ),
CALCULATE ( SUM ( Sheet1[Amount] ) ),
,
DESC,
DENSE
)
)💌 If this helped, a Kudos 👍 or Solution mark ✅ would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
shashidhar
1 year agoFrequent Visitor
Hi HarishMJ ,
I’ve found a solution to your problem. Please see the measure below. Add this as a new measure to your report and check if it works. I’ve also implemented it in your shared dashboard using the RankX_new measure.
Let me know if you need further assistance!
Use this DAX code.
RankX_new =
IF (
ISFILTERED ( Sheet1[CIF] ) || ISFILTERED ( Sheet1 ),
RANKX (
ALL ( Sheet1[CIF] ), -- Clear other dimensions but keep CIF for ranking
CALCULATE ( SUM ( Sheet1[Amount] ) ),
,
DESC
),
RANKX (
ALL ( Sheet1[CIF] ), -- Explicitly rank across all CIF values
CALCULATE ( SUM ( Sheet1[Amount] ) ),
,
DESC
)
)
Measure implemented in the report please check below attachment.
If your proiblem is solved mark this as a solution and give rating this helps for me