Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I am looking for a way to get the cumulative total to show 0 when it is a negative number and then start cumulating again when the numbers are positive. The following is what I need it to do in the table. It needs to add prior period balance + ON PO + Demand to calculate On Hand (projected) but if the On Hand projected is a -ve number it needs to show 0 and then start accumulating from when the total is +ve. I am trying to create the blue highlighted column below:
Solved! Go to Solution.
I think this works, maybe, fingers crossed.
All calculated columns - have broken into steps to see what is going on.
net =
var AccumPO=CALCULATE(SUM(Table1[PO]),
FILTER(ALL(Table1),Table1[period]<=EARLIER(Table1[period])))
var AccumDemand=CALCULATE(SUM(Table1[Demand]),
FILTER(ALL(Table1),Table1[period]<=EARLIER(Table1[period])))
return AccumPO-AccumDemand+0offset = CALCULATE(Min(Table1[net]),
FILTER(ALL(Table1),Table1[period]<=EARLIER(Table1[period])))SOH(projected) =Table1[net]-[offset]
I think this works, maybe, fingers crossed.
All calculated columns - have broken into steps to see what is going on.
net =
var AccumPO=CALCULATE(SUM(Table1[PO]),
FILTER(ALL(Table1),Table1[period]<=EARLIER(Table1[period])))
var AccumDemand=CALCULATE(SUM(Table1[Demand]),
FILTER(ALL(Table1),Table1[period]<=EARLIER(Table1[period])))
return AccumPO-AccumDemand+0offset = CALCULATE(Min(Table1[net]),
FILTER(ALL(Table1),Table1[period]<=EARLIER(Table1[period])))SOH(projected) =Table1[net]-[offset]
Thank you this will work. I just need to apply this as a measure since I need to replicate it for multiple products. Thank you so much for your help! @rfigtree
Check out the November 2025 Fabric update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!