Forum Discussion
sadiahsapiee
Helper I
6 years agoCumulative value from measure column not correct
Why my DAX to calculate cumulative not continue from previous row? Week Confirm Del Plan CDP 2019/49 139 <- TableA 139 2019/50 281 <- TableA ...
- 6 years ago
Finally I got the solution
Cumulative CDP = SUMX(
FILTER (ALLSELECTED('Date');
'Date'[DateKey] <=MAX('Date'[Datekey]));
[Confirm Del Plan]
)
Thanks to all to Paul and Kentyler for the suggestion and idea.
kentyler
Solution Sage
6 years agoYou need to add a filter for the "del plan" to your CALCULATE
Something like this
CDP =
VAR DelPlan = MAX(tableb[Del Plan])
VAR DelPlan = MAX(tableb[Del Plan])
RETURN CALCULATE([Confirm Del Plan];
FILTER(ALLSELECTED('Date');
'Date'[DateKey] <=MAX('Date'[DateKey]);
tableb[Del Plan] = DelPlan
)
)
)
I just winged this. I did not create a table to test it. You capture the current row plan in a variable, and then filter your aggregation to only total for rows that have that same plan.
I learn something every time I answer a question
I just winged this. I did not create a table to test it. You capture the current row plan in a variable, and then filter your aggregation to only total for rows that have that same plan.
I learn something every time I answer a question
sadiahsapiee
Helper I
6 years agoHi Kentyler,
Thank for your reply.
I still did not get it -add filter for 'Del plan' to the CALCULATE
CDP =
VAR DelPlan = MAX(tableb[Del Plan])
VAR DelPlan = MAX(tableb[Del Plan])
RETURN CALCULATE([Confirm Del Plan];
FILTER(ALLSELECTED('Date');
'Date'[DateKey] <=MAX('Date'[DateKey]);
tableb[Del Plan] = DelPlan
tableb we calculate del_qty for same week & item. MAX(tableb[Del Pan] is it Date or del_qty? I tried both did not work.