Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have this measure
I have reworked the measure and now I have this
As I use this
Hi,
Share the download link of your PBI file.
I wish I could, but data needs to be protected.
Hi,
Anonymise some data clearly showing the issue that you are facing and share the download link of that PBI file.
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
)
)
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.
cRecord is just a variable name. You can call it whatever you want, but i'm labeling it as cRecord to indicate that it is the current record on the visual.
The divide is used to convert a whole number into a decimal number. The tiebreaker looks at all visible output and returns a tiebreaker score starting from 1 and upwards until your last visible record.
If you break down the output it would be something simlar (considering lowest count is ranked 1):
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],
Working on it. Do cRecord and tmpRank need to be columms or can they be measures?
@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
)
)
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.
@bdehning that's correct.
You need both the sum and the count. One of the two will act as your tiebreaker.
I appreciate your help.
But we actually want to find the top 5 by count first and then use the Sum of Total Gross as tie breaker. If Top 5 is found 1-5, then no Sum is needed.
If we get the Top Part working above and you understand how I need Sum to be used, we could be getting close
Working on it. Do cRecord and tmpRank need to be columms or can they be measures?
Almost there but I have this
I want
1
2
3
4
5
6
7
8
9
10
11
User | Count |
---|---|
98 | |
90 | |
83 | |
70 | |
67 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |