Это, наверное, самый простой в мире рекурсивный CTE, который вы могли бы найти.
Но вот оно:
declare @years table(y int, p int)
insert @years values (2015,1000),(2016,2000),(2017,500),(2018,1000)
; with cumulative as
(
select top 1 * from @years order by y
union all
select y.y, y.p+c.p
from @years y
join cumulative c on y.y=c.y+1
)
select * from cumulative
Результат:
y p
2015 1000
2016 3000
2017 3500
2018 4500