Dynamic Date Reference Lines in Tableau

Reference lines are great way to help users understand the data in your visualisations

In this guide I will show you how to make a dynamic reference line using parameters

For this example, I'll use a line chart showing sales over time (month) using the superstore dataset. We will be adding a vertical reference line for month that can be manually adjusted by the user.

First let's create a parameter that will allow the user to select a date. Go to the left hand side of Tableau and select the carrot next to the search bar - select 'Create Parameter'

You'll be greeted with this window:

We are going to change the following parameter settings

  1. Name your parameter
  2. Change the data type to match what you would like your reference line to refer to, in this case "Date"
  3. Choose the "Range" option in Allowable values
  4. For this example, we set our Minimum value as 01/01/2018 - we want it to be on the first of the month so that our reference line will line up with the data points on the line chart. If we were to choose another date, the reference won't line up correctly
  5. Set maximum to whatever date you'd like your user to be able to reach. In our case this will be the last value in our dataset
  6. Set Step size to 1 Month. You can change this if you would like.

Now right click your x axis and select 'Add Reference Line'.

Another window will be displayed. Change our value to the parameter we have just made.

You'll now have a reference line but you won't be able to adjust it. Head over to the data pane and right click your parameter - select 'Show Parameter'

Your parameter control will now show on the right hand side - your user can now choose where they want their reference line.

And that's it! We can generate a similar reference line for sales as well if you would like but we now have a dynamic date reference line.

Author:
Jacob Kilroy
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab