Forum Discussion

zivhimmel's avatar
zivhimmel
Icon for Resolver I rankResolver I
9 years ago
Solved

Calculate SUM for latest dates

Hi, Here's what I'm trying to do, complete with data samples. Let's assume I have a "contributions" table, which looks like this:                 As you can see, a user can contribua...
  • v-ljerr-msft's avatar
    9 years ago

    Hi zivhimmel,

     

    Based on my test, you should be able to use the formula below to create a new measure to calculate the sum of the latest contributions in your scenario. :smileyhappy:

    sum of the latest contributions =
    SUMX (
        SUMMARIZE (
            contributions,
            contributions[User],
            "LatestContributions", CALCULATE (
                SUM ( contributions[Contribution] ),
                FILTER ( contributions, contributions[DateID] = MAX ( contributions[DateID] ) )
            )
        ),
        [LatestContributions]
    )
    

     

    Regards