Forum Discussion

Le-menace's avatar
Le-menace
Icon for Helper I rankHelper I
5 years ago
Solved

Cumulative calculated column (grouped by)

I have a simple table with daily records which I want to accumulate in a new column (a measure is not an option due to other stuff I'd like to do afterwards).   I've managed to find an easy way to ...
  • mahoneypat's avatar
    5 years ago

    Please try this column expression instead, replacing Table with your actual table name throughout.

     

    Cumulative Total =
    VAR __thisdate = Table[Date]
    RETURN
        CALCULATE (
            SUM ( Table[Value] ),
            ALLEXCEPT (
                Table,
                Table[Name]
            ),
            Table[Date] <= __thisdate
        )

     

    Regards,

    Pat