KNOWLEDGE BASE

Create a Reference Line for Today's Date


Published: 30 Mar 2015
Last Modified Date: 22 Nov 2017

Question

How to create a reference line on a date axis that always shows today's date.

Environment

Tableau Desktop

Answer

Create a calculated field that returns today's date to use as a reference line.

The attached example workbook uses the sample data set Superstore to demonstrate the following directions:
  1. Drag [Order Date] to the Columns shelf
  2. Right-click [Order Date] on the Columns shelf and select the second Month
  3. Drag [Sales] to the Rows shelf
  4. Select Analysis > Create Calculated Field
  5. In the Calculated Field dialog box that opens, do the following, and then click OK:
    • Name the calculated field. In this example, the calculated field is named "Today's Date"
    • In the formula field, create a calculation similar to the following:
       TODAY()
  6. Drag [Today's Date] to Detail on the Marks card
  7. Note: This step is necessary because reference lines can only be created from data in the view.
  8. Right-click [Today's Date] on the Marks card and select Exact Date
  9. Right-click the date axis and select Add Reference Line
  10. In the Add Reference Line, Band, or Box dialog, do the following and click OK:
    • For Value, select Today's Date from the dropdown
    • Format the reference line as desired
Did this article resolve the issue?