Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I am in need of calculating monthwise average, where
Average = (Jan value + Current Month Value) / 2
Eg: need values in column Avg Val
Month | Act Val | Avg Val |
Jan | 10 | 10 |
Feb | 15 | 12.5 |
Mar | 25 | 17.5 |
Apr | 40 | 25 |
May | ||
Jun | ||
Jul | ||
Aug | ||
Sep | ||
Oct | ||
Nov | ||
Dec |
But this doesn't happen as the Jan Value shows as zero in all subsequent months since the chart is monthwise.
Is there any method in set analysis to achieve the same.
thanks,
Florence
HI
Try like below
(Sum([Act Val]) + Sum({<Month = {'Jan'}>}Total [Act Val]))/2
In this case, i get below result:
Month | Act Val | Avg Val |
Jan | 10 | 10 |
Feb | 15 | 12.5 |
Mar | 25 | 17.5 |
Apr | 40 | 25 |
May | 5 | |
Jun | 5 | |
Jul | 5 | |
Aug | 5 | |
Sep | 5 | |
Oct | 5 | |
Nov | 5 | |
Dec | 5 |
but the avg value should come only upto April, which is the selected month. The remaining months should be zero.
Hi
Try like below
If(Sum([Act Val]) > 0, (Sum([Act Val]) + Sum({<Month = {'Jan'}>}Total [Act Val]))/2)