Field relative to average per slice


I’d like to show the perturbation of a field (point array) relative to the average along one coordinate (or more precise: For each point, I want to compute the percentage perturbation of a parameter relative to the depth-average).

I’ve tried the calculator functionality but I don’t know how to get a 3-D output from there (I can only get the overall mean of the parameter, and not per depth slice).

Does anybody have an idea how to approach this?