Calculating Year to Date Versus Previous Year to Date in Tableau

There will likely be times when you want to calculate performance year to date versus the same time period prior year to date.

The output might look something like this:

36-1.png

It takes a handful of calculations to do this. We’ll start by creating a year to date calculation:

36-2.png

Next we’ll create a previous year to date calculation:

36-3.png

The combination of the DATEPART() function and the ‘dayofyear’ date value is pivotal here. The way this works, 2/1/17 would be returned as day of year 32.

Last we’ll create a calculation that finds the growth percentage this year:

36-4.png

After adjusting the % growth calculation to have a percentage number format our results looks like this:

36-5.png

 

Need more help? Sign up for an office hour to get some extra help!