Forum Discussion
Calculated Column - Cumulative sum
- Anonymous3 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 ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.
- pietra3 years agoNew Member
Thank you so much for the support, it worked.
- Fahad123 years agoFrequent Visitor
I tried using your code in a similar problem I have.. However, it doesn't accept the last part:
EARLIER ( 'Sheet1'[Date] )
it doesn't accept the column name it gives me an error and says "can't find name" even though I just refereenced the same column in the first part:
'Sheet1'[Date] <= EARLIER ( 'Sheet1'[Date] )
any help on how to resolve it?