Forum Discussion

pietra's avatar
pietra
New Member
3 years ago
Solved

Calculated Column - Cumulative sum

I've searched the forum, but the main advice is to create a measure. I need to create a calculated column, which will sum the cumulative value during the year, for each service in each company.   ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi pietra ,

     

    Please try this code to create a calcualted column.

    Cumulative value = 
    CALCULATE (
        SUM ( 'Sheet1'[Value] ),
        FILTER (
            ALLEXCEPT ( 'Sheet1', 'Sheet1'[Company] ),
            'Sheet1'[Date] <= EARLIER ( 'Sheet1'[Date] )
        )
    )

    My Sample:

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.