In the attached workbook I set up a simple version. There's a calculated field called 12/2/11 to 12/31/11 avg with the following formula:
With the Compute Using set to Date, this gets the first 21 rows of the data set, which are the 2011 data. The latter two arguments could be changed to use a different window of data in the partition, and be made quite dynamic using parameters if you wanted.
Then the % difference is calculated using those results and plotted.
stock price average.twbx.zip 59.6 KB
Thanks for your help Jonathan!