Forum Discussion
Cumulative Total Not Working Properly
- 6 years ago
Hi AltGr9
I think there must be another sort column in play (possibly on 'Dimension Month[YearMonth]).
Try the expression below, which will remove all filters from the 'Dimension Month' table apart from Month ID <= MaxMonthID:
Ordered Running Total = VAR MaxMonthID = MAX ( 'Dimension Month'[Month ID] ) VAR Result = CALCULATE ( SUM ( 'Fact Monthly Project Rollup'[Capital Expenditure] ), FILTER ( ALL ( 'Dimension Month' ), 'Dimension Month'[Month ID] <= MaxMonthID ), 'Dimension Capital Expenditure Type'[Capital Expenditure Type] = "Ordered" ) RETURN ResultBest regards,
Martyn
Hi AltGr9
Is the 'Month Name Alternative' column in your month dimension table sorted by another column?
If so, you'll need to include that in your measure too. Something like:
Ordered Running Total =
VAR MaxMonthID = MAX ( 'Dimension Month'[Month ID] )
VAR Result =
CALCULATE (
SUM ( 'Fact Monthly Project Rollup'[Capital Expenditure] ),
ALL( 'Dimension Month'[Month Name Alternative], 'Dimension Month'[Month Name Alternative Sort] ),
'Dimension Month'[Month ID] <= MaxMonthID,
'Dimension Capital Expenditure Type'[Capital Expenditure Type] = "Ordered"
)
RETURN Result
Best regards,
Martyn
- AltGr96 years ago
Helper I
Thank you very much Martyn. The column was indeed sorted by another, and I added that to the ALL clause of both of the measures making up my Committed measure: [Ordered Running Total] and [Received Running Total].
Unfortunately, it didn't work. Same result as before.
- MartynRamsden6 years ago
Solution Sage
Hi AltGr9
I think there must be another sort column in play (possibly on 'Dimension Month[YearMonth]).
Try the expression below, which will remove all filters from the 'Dimension Month' table apart from Month ID <= MaxMonthID:
Ordered Running Total = VAR MaxMonthID = MAX ( 'Dimension Month'[Month ID] ) VAR Result = CALCULATE ( SUM ( 'Fact Monthly Project Rollup'[Capital Expenditure] ), FILTER ( ALL ( 'Dimension Month' ), 'Dimension Month'[Month ID] <= MaxMonthID ), 'Dimension Capital Expenditure Type'[Capital Expenditure Type] = "Ordered" ) RETURN ResultBest regards,
Martyn
- AltGr96 years ago
Helper I
Greatly appreciated!