Forum Discussion
ElliotP
10 years agoPost Prodigy
Cumulative Total
Hi, I'm at an absolute loss as to how to calculate a cumulative total. I've tried googling, reading the forums, following the documentation, decomposing the calculation, trying it as both a measu...
- 10 years ago
ElliotP Sorry about the original post. It was from my phone and had typos :smileywink:
Okay here is the formula for Running Total as a Calculated Column (prorerly formatted)
Running Total COLUMN = CALCULATE ( SUM ( 'All Web Site Data (2)'[UniquePageviews] ), ALL ( 'All Web Site Data (2)' ), 'All Web Site Data (2)'[Date] <= EARLIER ( 'All Web Site Data (2)'[Date] ) )And as you can see it works! :smileyhappy:
And here's the MEASURE formula
Running Total MEASURE = CALCULATE ( SUM ( 'All Web Site Data (2)'[UniquePageviews] ), FILTER ( ALL ( 'All Web Site Data (2)' ), 'All Web Site Data (2)'[Date] <= MAX ( 'All Web Site Data (2)'[Date] ) ) )Which also works...
Anonymous
3 years agoNot applicable
I FINALLY FIGURED OUT HOW TO DO THIS FOR A COLUMN OF STRINGS
There's definitely a better way but I started by making a calculated column which converts my strings to numbers. In the example below, I was counting all parts that were not "good"
Calculated Column:
converter column = IF('table'[quality] == "Good", 0, 1)
Running Total =
CALCULATE (
SUM ('table'[converter column] ),
ALLEXCEPT ('table', table[converter column]),
'table'[Tool Time] <= EARLIER ( 'table'[Tool Time] )
)