Forum Discussion
Anonymous
7 years agoNot applicable
Cumulative Sum with filter
I am trying to do a cumulative measure to add to a chart, however becuase my data structure consist of stacked monthly reports if I do so using the below code I end up with summing over repeated inst...
- 7 years ago
Ohh now I understand! Try this! :-)
Cumulative Quantity := VAR _date = SELECTEDVALUE('Table'[Date] )
VAR _period = SELECTEDVALUE('Table'[Report Date]) Return CALCULATE ( SUM ( Transactions[Quantity] ), ALL ( 'Table' ), 'Table'[Date] <= _date,
'Table'[Report Date] = _period
)
tex628
Community Champion
7 years agoTry this:
Cumulative Quantity :=
VAR Mdate = MAX ( 'Date'[Date] )
Return
CALCULATE (
SUM ( Transactions[Quantity] ),
FILTER (
ALL ( 'Date'[Date] ),
'Date'[Date] <= Mdate )
)Br,
Johannes