2 Replies Latest reply on Dec 9, 2018 6:58 PM by Richa Maheshwari

# How to calculate percentage difference without using quick calculations?

Hi Tableau enthusiasts,

My data has Consumer Revenue numbers and I am trying to calculated the percentage growth of the rolling 12 months.

Eg:

Month & Year

Consumer Revenue

June 20172000
July 20171500
August 20172000
September 20172000
xxxxxxxxxxxxxxxx
July 201810000
August 201820000

To derive the 1 year consumer revenue (rolling months), the formula i used is: WINDOW_SUM(SUM([Consumer Revenue]),-11,0)

Result:

Month & Year

Consumer Revenue

1 Yr Consumer Revenue

June 201720002000
July 201715003500
August 201720005500
September 201720007500
xxxxxxxxxxxxxxxxxxxxxxxxx
July 201810000150000
August 201820000155000

PS: 'xxxx' reflects hidden data from October 2017 to June 2018

From the 1 Yr Consumer Revenue data, I want to find the percentage difference month on month of the 1 Yr Consumer revenue. I generally use quick calculations to find the percentage difference, but since this is a derived column, that option isn't there.

Can someone help me how to go about with it?

Thank you.

• ###### 1. Re: How to calculate percentage difference without using quick calculations?

% differnce internally is (ZN(SUM([Profit])) - LOOKUP(ZN(SUM([Profit])), -1)) / ABS(LOOKUP(ZN(SUM([Profit])), -1))

Thanks,

Ritesh

• ###### 2. Re: How to calculate percentage difference without using quick calculations?

Hi Ritesh,

This helped. Can you tell me a way in which i can avoid getting numbers which do not fall under the rolling 12 months?

Month & Year

Consumer Revenue

1 Yr Consumer Revenue

June 201720002000
July 201715003500
August 201720005500
September 201720007500
xxxxxxxxxxxxxxxxxxxxxxxxx
July 201810000150000
August 201820000155000

PS: 'xxxx' reflects hidden data from October 2017 to June 2018

Can i get this?

Result:

Month & Year

Consumer Revenue

1 Yr Consumer Revenue

June 20172000
July 20171500
August 20172000
September 20172000
xxxxxxxxxxxxxxxxxxxxxxxxx
July 201810000150000
August 201820000155000

I do not want the cumulative numbers which do not fall under the rolling 12 months.

Thank you.