5 Replies Latest reply on Dec 20, 2016 7:27 AM by Shinichiro Murakami

# Need help to create year on year percent change chart with over 12 months on x-axis

I am hoping someone can help me learn how to create a year on year percent change line chart with over 12 months on the x-axis (e.g. 18 months).  In the attached you'll see that I'm able to create a chart with 12 months on the x-axis, however I'm unable to extend the lines into the previous year.  End game I am hoping for is for each of the region lines to show 18 months of year on year percent change.  So the x-axis would start with July 2013 (which would be percent change between July 2012 and July 2013), and end with December 2014 (which would be the percent change between December 2014 and December 2013).

Context of my question is a test vs. control scenario, where my test period extends over 12 months.  You'll see that I've mocked up an example using superstore data (Tableau 9.3).

• ###### 1. Re: Need help to create year on year percent change chart with over 12 months on x-axis

David,

Yes, may people get in trouble with data filter and display filter.

In this case, you need to filter thru display filter to show only the last 18 months with data of the last (18+12) months.

To do that, need to use table calculation and index filtering.

[Display Filter]

last()

Thanks,

Shin

• ###### 2. Re: Need help to create year on year percent change chart with over 12 months on x-axis

Shin, thank you very much.  Would you know of a way to have lines connect as they cross years?

• ###### 3. Re: Need help to create year on year percent change chart with over 12 months on x-axis

[Sales % vs 12 months before]

sum([Sales])/lookup(sum([Sales]),-12)

And could you mark my answer as correct.

Thanks,

Shin

• ###### 4. Re: Need help to create year on year percent change chart with over 12 months on x-axis

Thanks Shin, made a tweak to your calculated field: (ZN(SUM([Sales])) - LOOKUP(ZN(SUM([Sales])), -12)) / ABS(LOOKUP(ZN(SUM([Sales])), -12)).

Thanks again for your help. - Dave

• ###### 5. Re: Need help to create year on year percent change chart with over 12 months on x-axis

You are very welcome.

Thanks,

Shin