Show number of cases of the last date

RonaldLieuw

New member
Joined
Sep 5, 2019
Messages
13
Reaction score
0
Points
0
Excel Version(s)
2010
Hi, I am trying to make a card in Power BI with the number of cases on the last day of the data set e.g

The card should show 17,238 - 2/3/2020.

I made a measure MaxDay = MAX(China[Date]), which shows the correct (last) date.
I made another measure LastValue and then filtered on MaxDay

LastValue = CALCULATE(SUM(China[Confirmed (new cases)]), FILTER('China', China[Date] = [MaxDay]))

I am still getting the Total value of the column [Confirmed (new cases)] 79,471 instead of 17,238.
Pbix file included.

Can some one help?
 

Attachments

  • nCovChina.pbix
    266.7 KB · Views: 7
This is the solution:

LastValue3 = var maxdaychina = Calculate(Max(China[Date]),All(China))
return
CALCULATE(SUM(China[Confirmed (new cases)]), FILTER(China, China[Date] = maxdaychina))
 
Back
Top