I\'ve spend hours trying different combinations of SWITCH(True...) and subtractions to correctly calculate this but cannot find a solution.
For example, I have the follow