Jump to content

Cumulative Sum of an Average


John
Go to solution Solved by Vincent Thuilot,

Recommended Posts

Hi!

is anyone know how to do cumulative sum of an average? or any alternative solution below?

image.png.3edf6e34aa91ff9183be6ebf677d21a3.png

for above data, I want to have a cumulative average of a column so i can have the the total hours on the last step. Thanks!

 

Link to comment
Share on other sites

  • Solution
Posted (edited)

Hi John,

Yes there are a few options:

The main one would be like this:
Avg([Sales]) THEN SUM([Value]) OVER (AllPrevious([Axis.Rows])) 

it calculates the cumulative sum of the avg, here the results:
image.png.104375352f3613b0b9c719867cfc03be.png

when doing this you could also be interested in calculating the avg of all avg up to a certain row, and that would give this (Option 2):

Avg([Sales]) THEN Avg([Value]) OVER (AllPrevious([Axis.Rows])) 

image.png.1658dd37f159108778e575eea81d0b2f.png

 

You can generate these fast by using the Cumulative SUM out-of-the-box option and tweak the code to replace the first SUM by AVG.

image.png.dfa83e773dac2584e9c8d4a726aad22a.png

 

Hope it helps!

Edited by Vincent Thuilot
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...