Forum Discussion
bdehning
3 years agoPost Prodigy
Rank Measure
I have this measure Rank Product = IF ( ISINSCOPE( 'InjuryCause'[Cause Grouping]), RANKX ( CALCULATETABLE ( VALUES ( 'InjuryCause'[Cause Grouping]), ...
hnguy71
3 years agoSuper User
bdehning ,
In this case, you need a sort of ... tiebreaker. Try something like this...
VAR _TieBreaker =
IF(
ISINSCOPE('InjuryCause'[Cause Grouping]),
VAR _cRecord = MAX('InjuryCause'[Cause Grouping])
VAR _tmpRank = COUNTROWS( FILTER(ALL('InjuryCause'), 'InjuryCause'[Cause Grouping] >= _cRecord ))
RETURN _tmpRank
)
RETURN
IF(
ISINSCOPE( 'InjuryCause'[Cause Grouping]),
RANKX (
CALCULATETABLE (
VALUES ( 'InjuryCause'[Cause Grouping]),
ALLSELECTED ( 'InjuryCause'[Cause Grouping] )
),
[Count of Total Gross Incurred] + DIVIDE(_TieBreaker, 100),
,
DESC,
DENSE
)
)bdehning
3 years agoPost Prodigy
Ok excuse my novice to this, what is cRecord and why the divide?
All I want to do it use the Count of Total Gross Incurred to establish the rank and then use Sum of Total Gross Incurred for each Cause Group to break the tie.