Forum Discussion
Anonymous
7 years agoNot applicable
Cumulative total by quarters
Hi, I'm trying to compute a cumulative total by quarter. My table has 4 columns : Entity (A, B, C, etc.) // Year (2017, 2018, 2019, etc.) // Quarter (Q1, Q2, Q3, Q4) // Values I woud li...
- Anonymous7 years ago
My apologies, missed that conditional statement:
Measure:= VAR CurrentYear = MAX(<TableName>[Year]) RETURN CALCULATE( SUM(<TableName>[Values]) ,FILTER( ALL(<TableName>[Year]), <TableName>[Year] <= CurrentYear ) )
This first identifies the year in the current filter context, and then only includes years that are less than or equal to that value.
Anonymous
7 years agoNot applicable
Thank you for your answer.
While doing this, I get on each row the same value as in the column "value".
Where is the condition that rows to be considered in the sum should have a year less or equal to current row ?
Thanks a lot !
Anonymous
7 years agoNot applicable
My apologies, missed that conditional statement:
Measure:= VAR CurrentYear = MAX(<TableName>[Year]) RETURN CALCULATE( SUM(<TableName>[Values]) ,FILTER( ALL(<TableName>[Year]), <TableName>[Year] <= CurrentYear ) )
This first identifies the year in the current filter context, and then only includes years that are less than or equal to that value.