Checking if some one can help me for a solution, I have a customized power apps form, I’m trying to have running total, update as zero when the running total goes to negative and reset & recalculate from next item. Hope I can get help.

Checking if some one can help me for a solution, I have a customized power apps form, I’m trying to have running total, update as zero when the running total goes to negative and reset & recalculate from next item. Hope I can get help.
I have managed to find the solution to bring the Running total and update as zero when the running total goes to negative. I have to find solution for last part only reset & recalculate from next item. If some one already have a solution, please help.