Forum Discussion

BusinessAnalyst's avatar
10 years ago
Solved

cumulative running sum

Dear experts, I would like to ask solutions to create a column which summarizes cumulatively value in column "Total" based on column "Date", in 3-day period, for example: Cumulative sum of "Total" ...
  • jahida's avatar
    jahida
    10 years ago

    KGrice 's solution will work for sure, seems a bit of overkill to have 3 filter clauses for this though. Here's a compressed alternative with the same result:

     

    MovingSum = CALCULATE(SUM(Table2[Total]),
    		FILTER(ALLEXCEPT(Table2, Table2[Id]), Table2[Date] > MAX(Table2[Date])-2 && Table2[Date] <= MAX(Table2[Date])))