Get Ready For Your Tableau Certification
  • Bernard

Computing Year to Date (YTD) vs Previous Year to Date (PYTD) in Tableau


computing year to date vs previous year to date in Tableau

Year to Date (YTD) – refers to the period beginning from the first day of the current calendar year or fiscal year up to the current date.

Previous Year to Date (PYTD) – refers to the period beginning from the first day of the previous calendar year or fiscal year to the date equivalent to the current day from the previous year.

To demonstrate this, I will be using the Sample-Superstore data.

Computing YTD

Using the current date – (the function TODAY()), you can compute the year-to-date sales using any of the following formulas.

computing ytd in tableau
computing year to date in tableau
ytd in tableau

(Note, when you add any of the above formulas to the view – results to the same value, that is 448,631 for my case - which is the sales between January 1st, 2021, and the current date - September 25th, 2021.)

Computing PYTD

Using the current date again, I can compute the previous year to date sales using any of the following formulas.

computing previous year to date in tableau
pytd in tableau

(Note, when you add any of the above formulas to the view – results to the same value. That is 366,483 for my case – which is the sales between January 1st, 2020, and September 25th, 2020)

I hope this article was helpful to you. To receive more of the Tableau tips, kindly join our mailing list by subscribing below.

Thank you for reading.

LEAD MAGNET - 2.png
FREE INTRO COURSE -2.png