Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

calculate Running sum over Date

Hi all,

 

I want to calculate running sum over date. In the data shown i want to calculate column c (which is cooming from column B)

Thanks

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    Try this formula: 

    Running Total = 
    CALCULATE (
        SUM ( TableName[gp] ),
        FILTER (
            ALL ( TableName[date] ),
           TableName[date] <= MAX ( TableName[date] )
        )
    )

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Try this formula: 

    Running Total = 
    CALCULATE (
        SUM ( TableName[gp] ),
        FILTER (
            ALL ( TableName[date] ),
           TableName[date] <= MAX ( TableName[date] )
        )
    )
  • Hi,

    Create a Calendar Table and build a relationship from the Date column of your Data Table to the Date column of the Calendar Table.  To your visual, drag Date from the Calendar Table.  Write these measures

    GP Total = SUM(Data[GP])

    Cumulative GP Total = CALCULATE([GP Total],DATESBETWEEN(Calendar[Date],MINX(ALL(Calendar),Calendar[Date]),MAX(Calendar[Date])))

    Hope this helps.