Summation of data to a given depth

I want to calculate the sum of data in a field up to a given depth, for all depths at a point, which I want to later use in other calculations.

How can I accomplish that?