Forum Discussion

excelso21's avatar
excelso21
Frequent Visitor
8 years ago
Solved

Remaining Amount Sum

I have a situation where I have to sum the remaining values of a certain model.   My Table in the data model looks like this:  ID Value Date    Amount  Creation Date 1   01/01/2018      1 000    ...
  • v-ljerr-msft's avatar
    8 years ago

    Hi excelso21,

     

    If I understand you correctly, the formula below should work in your scenario. :smileyhappy:

    Measure = 
    VAR firstDateOfMonth =
        FIRSTDATE ( 'Calendar'[Date] )
    VAR maxCreationDate =
        MAX ( Table1[Creation Date] )
    RETURN
        CALCULATE (
            SUM ( Table1[Amount] ),
            FILTER (
                Table1,
                Table1[Creation Date] >= firstDateOfMonth
                    && Table1[Creation Date] < maxCreationDate
            )
        )

     

    Regards