Results 1 to 2 of 2

Thread: Show number of cases of the last date

  1. #1
    Seeker RonaldLieuw's Avatar
    Join Date
    Sep 2019
    Posts
    13
    Articles
    0
    Excel Version
    2010

    Show number of cases of the last date



    Register for a FREE account, and/
    or Log in to avoid these ads!

    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?
    Attached Files Attached Files

  2. #2
    Seeker RonaldLieuw's Avatar
    Join Date
    Sep 2019
    Posts
    13
    Articles
    0
    Excel Version
    2010
    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))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •