Forum Discussion
Lenastray
7 years agoHelper I
Help previous sum
Hello. For calculating the cumulative total I make use of the following dax pattern: CALCULATE (
SUM ( Table[numericValue] ),
ALLEXCEPT ( Table, Table[Dates], Table[Attribute1], T...
- 7 years ago
Something like this should work. All I've done is change the first argument of the CALCULATE function to a further CALCULATE, with Table[Dates] filtered to the latest date subject to the filters of the outer CALCULATE. Also removed Dates from ALLEXCEPT.
=
CALCULATE ( CALCULATE ( SUM ( Table[numericValue] ), LASTDATE ( Table[Dates] ) ), ALLEXCEPT ( Table, Table[Attribute1], Table[Attribute2] ), Table[Dates] < EARLIER ( Table[Dates] ) )Regards,
Owen
OwenAuger
7 years agoSuper User
Something like this should work. All I've done is change the first argument of the CALCULATE function to a further CALCULATE, with Table[Dates] filtered to the latest date subject to the filters of the outer CALCULATE. Also removed Dates from ALLEXCEPT.
=
CALCULATE ( CALCULATE ( SUM ( Table[numericValue] ), LASTDATE ( Table[Dates] ) ), ALLEXCEPT ( Table, Table[Attribute1], Table[Attribute2] ), Table[Dates] < EARLIER ( Table[Dates] ) )
Regards,
Owen
- Lenastray7 years agoHelper I
It works like a charm. The innermost calculate is the last one in excecute, so it filter the lastdate there. Excelent, thank you so much Owen.