Forum Discussion
Help on cumulative calculation
- 6 years ago
Hi Anonymous ,
We can nest an IF function outside the original formula to meet your requirement.
Measure = IF ( MAX ( 'Table'[value] ) = 0, 0, VAR x = MIN ( 'Table'[month number] ) RETURN CALCULATE ( SUM ( 'Table'[value] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[month number] <= x ) ) )The result like this,
For the sample, we add a new row, what is your expected result for May, 6 or 1?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
We can nest an IF function outside the original formula to meet your requirement.
Measure =
IF (
MAX ( 'Table'[value] ) = 0,
0,
VAR x =
MIN ( 'Table'[month number] )
RETURN
CALCULATE (
SUM ( 'Table'[value] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[month number] <= x )
)
)
The result like this,
For the sample, we add a new row, what is your expected result for May, 6 or 1?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
perfect