Forum Discussion
Mystery
Helper I
6 years agoCumulative Sum using DAX
Hi, I am trying to compute the cumulative sum using below DAX formula: Cumulative SUM= VAR MAXDATE = CALCULATE (value(LEFT(MAX ('Date'[DateKey]),6) )) RETURN IF ( LEFT(MIN('Revenue'[DateK...
v-yuta-msft
Community Support
6 years agoMystery ,
You may try modifying the measure as below:
Cumulative SUM =
VAR MAXDATE =
VALUE ( LEFT ( MAX ( 'Date'[DateKey] ), 6 ) )
RETURN
IF (
LEFT ( MIN ( 'Revenue'[DateKey] ), 6 )
<= CALCULATE ( LEFT ( MAX ( 'Date'[DateKey] ), 6 ), ALL ( 'Date' ) ),
CALCULATE (
SUM ( 'Revenue'[ActualCount] ),
ALL ( 'Revenue' ),
VALUE ( LEFT ( 'Revenue'[DateKey], 6 ) ) <= MAXDATE,
'Revenue'[Col] = "ABC"
)
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mystery6 years ago
Helper I
Thanks but it doesnt work.