This is definitely the case
where Excel (with it's Cell-based calculations) shines,
whereas Tableau (with it's Set-based calcs) doesn't.
There is a recursion here in the calcs,
and the only recursive function in Tableau --
PREVIOUS_VALUE() -- doesn't suffice.
If it is an obligation to build such calculations in Tableau,
one should be using a distinct set of (nested Table) Calculations
for every new distinct Year-Quarter value (a column on a view).
This is complicated, error-prone, and it doesn't scale at all.
Anyway, please find the attached as an example of this brut-force approach.
Hope it could help understanding what Tableau is best for (and what it is not).
Test_YF.twbx 1.2 MB