I believe the formula shown in the attached screenshot shows what you need. Basically the formula says to take the current value of the attribute you are summing and add to it the previous value of the cumulative sum.
The prev function does the trick. Worth noting is that the second argument of the prev function is the value to use if the attribute has no previous value.