By: Eric Parker
Eric Parker lives in Seattle and has been teaching Tableau and Alteryx since 2014. He's helped thousands of students solve their most pressing problems. If you have a question, feel free to reach out to him directly via email.
(Prefer a video? Check out our 2021 updated video for Year to Date vs Previous Year to Date here!)
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:
It takes a handful of calculations to do this. We’ll start by creating a year to date calculation:
Next we’ll create a previous year to date calculation:
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:
After adjusting the % growth calculation to have a percentage number format our results looks like this:
Need more help? Sign up for an office hour to get some extra help!