Forum Discussion

Limerick's avatar
Limerick
Frequent Visitor
3 years ago
Solved

SUM dynamic / dependend on date

Hello together,    I have a table like this: What I need to do now, is to sum the amount for every row over the past 5 days, like this: So basically, sum everything up, where the date...
  • Ashish_Mathur's avatar
    3 years ago

    Hi,

    Create an Index column in the Query Editor and write this calculated column formula

    Column = CALCULATE(SUM(Data[Amount]),FILTER(Data,Data[Date]>=EARLIER(Data[Date])-4&&Data[Date]<=EARLIER(Data[Date])&&Data[Index]<=EARLIER(Data[Index])))

    Hope this helps.