Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Rolling 3 Month Sum

I am using the formula below to calculate a rolling 3 month total but I want to exclude the current month. So for April I want to sum up Jan - March.  Currently the formula sums Feb - Apr. How can I ...
  • mattbrice's avatar
    8 years ago

    Maybe this:

     

    Rolling 3 Month Total =
    CALCULATE (
        KPI_Finance_Actual_Budget[Actual Profit],
        DATESINPERIOD (
            KPI_Finance_Actual_Budget[FullDate],
            LASTDATE ( PREVIOUSMONTH ( KPI_Finance_Actual_Budget[FullDate] ) ),
            -3,
            MONTH
        )
    )

    Although if "KPI_Finance_Actual_Budget[FullDate]" doesn't have a consecutive range of all dates you may get some strange results.  Best to use a separate calendar table.