6 Replies Latest reply: Aug 18, 2018 12:09 PM by Max Pain

# calculation help

Hi Experts,

In the below pivot table I have 3 Dimensions, Month Column and One measure is

Sum({<Agency={'USA'}>}Sales) here I am getting below output.

In the below screen shot right now getting each month related sales.

The requirement is I have to show current month + Previous month sales under each month instead of actual month sales as mentioned in the expected output row

• ###### Re: calculation help

The simplest way is using before() function

Sum({<Agency={'USA'}>}Sales) + before(Sum({<Agency={'USA'}>}Sales), 1)

• ###### Re: calculation help

Hi,

• ###### Re: calculation help

Month

=RangeSum(Above(TOTAL Sum(Sales), 0, RowNo(TOTAL)))

• ###### Re: calculation help

I think this will calculate the right sum for you:

RangeSum( Before(TOTAL Sum(Sales),0,ColumnNo(TOTAL)))

• ###### Re: calculation help

Oh,  sorry, did not notice the accumulation

RangeSum(before(Sum({<Agency={'USA'}>}Sales), 0, ColumnNo(TOTAL))should work