Forum Discussion
Anonymous
4 years agoNot applicable
Need help reset count
Hi All, I've tried to calculate the total infected and recovered users every month, the total recovered doesn't matter but the total infected when the same users are infected again after recovery th...
- 4 years ago
I'd recommend looking at whatever the last status was.
Try something like this:
CountInfected = VAR LastStatusDates = ADDCOLUMNS ( VALUES ( Summary[User] ), "@LastStatusDate", CALCULATE ( MAX ( Summary[Date] ) ) ) RETURN SUMX ( LastStatusDates, LOOKUPVALUE ( Summary[Infected], Summary[User], Summary[User], Summary[Date], [@LastStatusDate] ) )
AlexisOlson
4 years agoSuper User
I'd recommend looking at whatever the last status was.
Try something like this:
CountInfected =
VAR LastStatusDates =
ADDCOLUMNS (
VALUES ( Summary[User] ),
"@LastStatusDate", CALCULATE ( MAX ( Summary[Date] ) )
)
RETURN
SUMX (
LastStatusDates,
LOOKUPVALUE (
Summary[Infected],
Summary[User], Summary[User],
Summary[Date], [@LastStatusDate]
)
)
- Anonymous4 years agoNot applicable
Perfect, It works as required too in different ways. Great Support. Thanks AlexisOlson