Forum Discussion

MiaZhao's avatar
MiaZhao
Helper I
8 years ago
Solved

Cumulative total based on a date column

Hi everyone,

 

How to calculate a cumulative sum based on the date column? For example, how to calculate the Total in the following table?

 

NameDateamountTotal 
A1.110 
A1.221 
A1.333=1+2
A1.446=1+2+3

 

  • MiaZhao

     

    Please try this column

     

    Column =
    CALCULATE (
        SUM ( Table1[amount] ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[Name] ),
            Table1[Date] < EARLIER ( Table1[Date] )
        )
    )

2 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    MiaZhao

     

    Please try this column

     

    Column =
    CALCULATE (
        SUM ( Table1[amount] ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[Name] ),
            Table1[Date] < EARLIER ( Table1[Date] )
        )
    )