Forum Discussion
IHam
7 years agoHelper III
Ranking vs Date
Hi, I am trying to plot a graph of an individual's rank vs time based on their cumulative points score. So for instance on day 1 someone is ranked 3rd with 100 points and then by day 3 they are 2nd w...
- 7 years ago
Hi Anonymous
You may check the Page2 in attached file.Add a calendar table to get the cumulative total.Add 0 to the blank cumulative total.Then rank it.
cumulative_points = IF ( MAX ( 'Calendar'[Dates] ) <= MAXX ( ALL ( 'Table' ), 'Table'[Date] ), CALCULATE ( SUM ( 'Table'[Points] ) + 0, FILTER ( ALLSELECTED ( 'Calendar'[Dates] ), 'Calendar'[Dates] <= MAX ( 'Calendar'[Dates] ) ) ) )Rank = IF ( MAX ( 'Calendar'[Dates] ) <= MAXX ( ALL ( 'Table' ), 'Table'[Date] ), RANKX ( ALL ( 'Table'[person] ), [cumulative_points],, DESC ) )Regards,
v-cherch-msft
7 years agoMicrosoft Employee
Hi Anonymous
You may check the Page2 in attached file.Add a calendar table to get the cumulative total.Add 0 to the blank cumulative total.Then rank it.
cumulative_points =
IF (
MAX ( 'Calendar'[Dates] ) <= MAXX ( ALL ( 'Table' ), 'Table'[Date] ),
CALCULATE (
SUM ( 'Table'[Points] ) + 0,
FILTER (
ALLSELECTED ( 'Calendar'[Dates] ),
'Calendar'[Dates] <= MAX ( 'Calendar'[Dates] )
)
)
)
Rank =
IF (
MAX ( 'Calendar'[Dates] ) <= MAXX ( ALL ( 'Table' ), 'Table'[Date] ),
RANKX ( ALL ( 'Table'[person] ), [cumulative_points],, DESC )
)
Regards,
IHam
7 years agoHelper III
That does the trick - many thanks for your help and patience with this!
I am much obilged