Chapter 53. 3 Innovative Ways to Use Dates: Tip 2

How to Normalize Current Dates and Prior Dates on One Axis

One of my favorite techniques that doesn’t happen out of the box for us in Tableau is to compare the performance of a selected date range to the performance of the date range immediately preceding it. For example, if I choose this week as the current date range, I want to see this week’s data in addition to last week’s data so that I can do an easy period-over-period analysis.

You can always set your date range filter to capture both time periods, but as Chapter 52 demonstrates, if you’re using a continuous axis, the dates will not be lined up on top of one another.

This chapter shows you how to compare any selected date range to the same number of days immediately preceding the selection—all on one axis so they’re lined up! Although I wrote about this in Practical Tableau, I found an even better approach to reduce the number of calculations required.

How to Equalize a Selected Date Range with a Prior Date Range on One Axis in Tableau

Before I share the technique for normalizing dates so that they line up period over period, let’s take a look at why this is needed.

Suppose that we want to look at the sales performance for the month of October 2023. No problem; here’s the Sales measure by continuous Order Date from the Sample – Superstore dataset, filtered to the month of October 2023:

Now let’s say that we want to do a month-over-month comparison. ...

Get Innovative Tableau now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.