Forum Discussion
Rank Measure
Having a hard time in getting this to work . We would need to use the Sum of Total Gross Incurred for each Cause Group to break the tie.
[Count of Total Gross Incurred] + DIVIDE(_TieBreaker, 100),
How could the Divide be swapped out to use the Sum of Total Gross Incurred for each Cause Group
bdehning it would just be replaced by your sum of total gross incurred. This would be then your tiebreaker value.
[Count of Total Gross Incurred] + [Sum of Total Gross Incurred],
- bdehning3 years agoPost Prodigy
Working on it. Do cRecord and tmpRank need to be columms or can they be measures?
- bdehning3 years agoPost ProdigySecond Return says Unexprected ReturnRETURN _tmpRank,RETURN
- bdehning3 years agoPost Prodigy
Almost there but I have 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,RETURNIF(ISINSCOPE( 'InjuryCause'[Cause Grouping]),RANKX (CALCULATETABLE (VALUES ( 'InjuryCause'[Cause Grouping]),ALLSELECTED ( 'InjuryCause'[Cause Grouping] )),[Count of Total Gross Incurred] + [Sum of Total Gross Incurred],,DESC,DENSE))It is not getting past the 2nd return as it says Unexpected Return?
- bdehning3 years agoPost Prodigy
Working on it. Do cRecord and tmpRank need to be columms or can they be measures?
- hnguy713 years agoSuper User
bdehning since you're not using the tiebreaker variable, you can get rid of it all
IF( ISINSCOPE( 'InjuryCause'[Cause Grouping]), RANKX ( CALCULATETABLE ( VALUES ( 'InjuryCause'[Cause Grouping]), ALLSELECTED ( 'InjuryCause'[Cause Grouping] ) ), [Count of Total Gross Incurred] + [Sum of Total Gross Incurred], , DESC, DENSE ) )- bdehning3 years agoPost Prodigy
I would need a tie breaker though as original data from Count only is
1
2
3
4
5
5
5
5
5
I ran the above and it ran and gave results of ranking I was looking, but is it only adding the Sum to the count and then ranking and we only got lucky? I do need the [Sum of Total Gross Incurred] as tie breaker if Count results in ties.