Forum Discussion

kkanda's avatar
kkanda
Icon for Resolver II rankResolver II
2 years ago
Solved

Cumulative total for month

Hi All, I have run into a problem I cannot resolve. I have set of dates, Target and Actual numbers in a table. I need to calculate the cumulative total for each day of the month. The logic appears t...
  • Fowmy's avatar
    2 years ago

    kkanda 

    Use this measure:



    RT_mnth =
    VAR __StartDate =
        EOMONTH ( MAX ( TestSh[DATE] ), -1 ) + 1
    VAR __LastDate =
        MAX ( TestSh[DATE] )
    RETURN
        CALCULATE (
            SUM ( TestSh[ACTUAL] ),
            TestSh[DATE] >= __StartDate,
            TestSh[DATE] <= __LastDate
        )