How to Tableau: Month to Date vs. Prior Year Month to Date

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. You can follow him on LinkedIn or sign up for a Tableau Office Hour to work with him directly!

How are things performing at your organization this month? How does that compare to the past? What if the best historical comparison isn't last month, but this month last year?

If you want to use Tableau to compare month to date performance for this month to the same month last year, you can! However, it's going to require a few custom calculations to get there.

Check out this video to learn how you can write the formulas you need to compare month to date year over year!

Access/download the Tableau Workbook from the demo here.

Formulas:

MTD Sales:

IF DATEDIFF('month',[Order Date ],TODAY()) = 0 THEN [Sales] END

PY MTD Sales:

IF DATEDIFF('month',[Order Date ],TODAY()) = 12

AND DAY([Order Date ]) <= DAY(TODAY())

THEN [Sales] END

YoY MTD Sales Diff.:

SUM([MTD Sales]) - SUM([PY MTD Sales])

Want to keep learning foundational skills in Tableau? Sign up for our weekly newsletter so you never miss new blog posts, videos and events!

Compare Running Sum Year Over Year in Tableau

Fiscal Year to Date vs. Prior Fiscal Year to Date in Tableau

0