This may not completely work for your final setup,
but as first step, you could try a combination of Lookup and Table Calculation:
[ID in prev year]:
IF LOOKUP ( ATTR ( [Year] ) ,-1 ) = ( ATTR ( [Year] )-1 ) THEN 1 ELSE 0 END
THEN WINDOW_SUM ( [ID in prev year] )
Please note: this requires a particular set up for "Compute Using"
when edit the table calculation.
[ID in prev year] is set to "Specific Dimensions" of [ID] then [Year]
At the level "Deepest", Restarting every [ID].
[Year Total] is nested with [Year Total]'s Compute Using set to [ID] and
[ID in prev year] as described above.
251200sum.twbx 42.3 KB