top of page
Bernard K

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

Updated: Nov 29, 2022


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.

If you like the work we do and would like to work with us, drop us an email on our Contacts page and we’ll reach out!

Thank you for reading!

Comments


Blog.png
Black & white.jpg

About Me

More About the Author

Bernard K

Analytics Consultant | 3X Tableau Certified

Bernard is a data analytics consultant helping businesses reveal the true power of their data and bring clarity to their reporting dashboards. He loves building things and sharing knowledge on how to build dashboards that drive better outcomes.

Let’s discuss your data challenges! Let’s work together!

bottom of page