2 Replies Latest reply on May 8, 2012 12:23 AM by puneeta.verma

# Calculating Average price of a product between 2 years

Hello,

I want to calculate the average price of a product between 2 fiscal years. Example:

price of Product P1 in 2009 = 100

price of Product P1 in 2010 = 200

price of Product P1 in 2011 = 150

So average price of Product P1 in 2010 = 100+200/2 = 150

in 2011 = 200+150 / 2 = 175

Quick table calculations are not giving me this desired data. Any suggestions on how to achieve this in Tableau?

Thanks,

Puneeta

• ###### 1. Re: Calculating Average price of a product between 2 years

Hi Puneeta,

If you have the year in the view, then a Quick Table Calculation can work, with one bit of configuration.. By default, Moving Average Quick Table Calculation looks at the 2 most recent periods plus the current one. You'll need to click on the measure's green pill, choose Edit Table Calculation... from the context menu, and then change Previous Values to 1 in the Table Calculation dialog that pops up.

If this doesn't work for you, then please post a packaged workbook with some sample data, because there are a variety of ways to get the calculation you desire and the method used depends on the data.

Cheers,

Jonathan

1 of 1 people found this helpful
• ###### 2. Re: Calculating Average price of a product between 2 years

Hello Jonathan,

Thank you for your reply. I have a year field (Fiscal Year).Changing previous value from 2 to 1 seems to calculate and give the desired data. Iam testing it now with more number of records . Thank you so much for your help!

Regards,

Puneeta