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...
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...
I've followed an identical approach as you have provided here but run into this issue when it comes to the current year context and the previous year calculating the full total as opposed to just the four months of this year.
- neilcotton4 years agoFrequent Visitor
Hi Anonymous
Make sure the code you are using has ALLSELECTED rather than just ALL in the filter part of the expression. This should then reflect the various slicers that you have employed on the page.
Regards
Neil
- Anonymous4 years agoNot applicableYep, I have that part in already
App Cumulative =CALCULATE([# Applications],FILTER(ALLSELECTED( 'Applications' ),'Applications'[APM_CREATED_DATE] <= MAX(Applications[APM_CREATED_DATE]))) - neilcotton4 years agoFrequent VisitorHi Anonymous, here is an example I am using that works for all filter selections on related tables. I am doing my date segmentation based on a calendar table.CumulativeInvoiceQty =CALCULATE( SUM ( FACT_SalesOrderLines[InvoicedSOQty] ),FILTER(ALLSELECTED ( 'DATE_TABLE' ),('DATE_TABLE'[Date]) <= MAX ( DATE_TABLE[Date] )))
- Anonymous4 years agoNot applicable
thanks neilcotton , I think the lack of a date table is probaly what's causing me the trouble I'm having. Will add one now and see where it gets me.