Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Dear Key Users,
How could I add addtional conditions to identify the row results in cumulative calculations
As in the Table below mentioned, I need to cumulative the "Qty Delta" sort by the Month level, thats give me the column "**bleep** Qty Delta" in dax,
But I want this dax formula to add condition is if the "**bleep** Qty Delta" is positive, then the next cumulative calculation will take this positive as 0 in the next calculation, like how this will performed in column "Correct **bleep** Delta"
Thanks a lot for your help!
Chrystal
Solved! Go to Solution.
Thanks for the reply from lbendlin.
Hi @Chrystal ,
Create a new column and try the following DAX formula:
Result =
VAR Currentmonth='Table'[Month]
VAR CurrentQtyDelta='Table'[Qty Delta]
VAR PreviousResult=CALCULATE(SUM('Table'[Qty Delta]),FILTER('Table','Table'[Month]<Currentmonth&&'Table'[Qty Delta]<0))
RETURN
IF(CurrentQtyDelta>0,CurrentQtyDelta,PreviousResult+CurrentQtyDelta)
Result:
Best Regards,
Zhu
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply from lbendlin.
Hi @Chrystal ,
Create a new column and try the following DAX formula:
Result =
VAR Currentmonth='Table'[Month]
VAR CurrentQtyDelta='Table'[Qty Delta]
VAR PreviousResult=CALCULATE(SUM('Table'[Qty Delta]),FILTER('Table','Table'[Month]<Currentmonth&&'Table'[Qty Delta]<0))
RETURN
IF(CurrentQtyDelta>0,CurrentQtyDelta,PreviousResult+CurrentQtyDelta)
Result:
Best Regards,
Zhu
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Conditional accumulation is impossible in DAX. The only way you can do this is in Power Query via List.Accumulate() .
Hi! thanks for your reply, I will check it out!!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |