3 Replies Latest reply on Nov 26, 2018 5:08 AM by Yuriy Fal

# Running Sum should get zero to the month where there is zero value in that month

Hi

I have scenario where i have to show running sum total on the trend for each month.

I used below calculation where i got the correct numbers till where there is data. But i'm getting the Sep month value for the next three months where the data is zero in Oct, Nov& Dec)

RUNNING_SUM(sum(if [Scenario]='Actual' then [Numerator] END)) / RUNNING_SUM(sum(if [Scenario]='Actual' then [Denominator] END))

all i want is running sum should become zero for last 3 months where i should not use filter on month dimension.

Appreciate quick help on this scenario.

• ###### 1. Re: Running Sum should get zero to the month where there is zero value in that month

Hi Yogish,

You may want to use an external condition in your calc like this

// All-in-one calc instead the original RUNNING one,

// could also be re-written as a Nested Calc referring the original

IF ZN( sum(if [Scenario]='Actual' then [Numerator] END) != 0

THEN

RUNNING_SUM(sum(if [Scenario]='Actual' then [Numerator] END))   /

RUNNING_SUM(sum(if [Scenario]='Actual' then [Denominator] END))

// ELSE 0

END

Yours,

Yuri

• ###### 2. Re: Running Sum should get zero to the month where there is zero value in that month

Thanks for the Quick response Yuri ..

Got exactly what i'm looking at.

your help is appreciated

Thanks

Yogish

• ###### 3. Re: Running Sum should get zero to the month where there is zero value in that month

Yogish, you're welcome.