Forum Discussion
Cumulative Total
- 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...
Did you read this article? It really explains everything you need to know about cumulative total
sdjensen I have read that article and that's the base I've been working off, yet to no avail. When I either attempt to impose the measure on a table or create a new column with that data it simply gives me the same value that corresponds with the data.
Photos to better demonstrate the issue:
https://gyazo.com/ca41ce0b2d8ec572608d4afda4cffd32
https://gyazo.com/4e8d9b3e1cc38c514048272ced01a534
https://gyazo.com/14a6089654df6e90e7fd5595fd842ebd
The Date colum is set to a date, the Unique Pageviews is set to Whole Numbers. I'm honestly lost at this point.
- Vvelarde10 years agoCommunity Champion
Replace this:
All(Allwebsitedata(2) [Date]),
By
All(Allwebsitedata(2)),
The reason is because you are using the date field in your data Table, if you'll use a calendar table the formula works perfects.
- ElliotP10 years agoPost Prodigy
Thank you so much, we're making progress.
I've tried it as a measure as well as a new calculated column, yet it shows the cumulative total in each row; photos to demonstrate;
https://gyazo.com/0d365fcaaba2507bca2dffe1177837eb
https://gyazo.com/37b810f7b9f4659492b405b3362106db
As well, what do you mean in regards to date field date table. Should I set it to another table type?
- Vvelarde10 years agoCommunity Champion
For a calculated column :
CumulativeQuantity2 =
VAR CURRENTDATE='All Web Site Data (2) '[Date]
RETURN
CALCULATE(SUM('All Web Site Data (2) '[UniquePagePreviews]);FILTER(all('All Web Site Data (2)');'All Web Site Data (2) '[Date]<= CURRENTDATE))For a measure:
CumulativeQuantity-M =
CALCULATE(SUM('All Web Site Data (2) '[UniquePagePreviews]);FILTER(all('All Web Site Data (2) ');'All Web Site Data (2) '[Date]<= MAX('All Web Site Data (2) '[Date])))I hope this help you.