Hello, I have been trying to create a measure that allows me to operate with itself (I have not been successful).

The idea (as seen in the table) is that I know the data I have in the row Days 14, column Start (31) and all the numbers in the subtraction column.

The idea is to generate the following operation:

Part the operation with the first data that is known (31), then there is a condition:

Day 13:

If Subtraction (of the corresponding day) is 0 then the total is 31 and therefore the start of the next day is 31.

Day 14:

If Subtraction (of the corresponding day) is 0 then the total is 31 and therefore the start of the next day is 31.

Day 15:

If subtract (from corresponding day) > 0 then the total is 31 - 3 = 28, and the start of the next day is 28.

Day 16:

If subtract (from corresponding day) > 0 then the total is 28 - 2 = 26, and the start of the next day is 26.

Day 18:

If subtract (from corresponding day) = 0 then the total is 15 , and the start of the next day is 15.

So until the last value