KNOWLEDGE BASE

Creating a Filter for Start and End Dates Using Parameters


Published: 17 Jan 2014
Last modified date: 27 Nov 2023

Question

How to create parameters to filter views to specific start and end dates.

Environment

Tableau Desktop

Answer

Step 1: Create Start Date and End Date Parameters

  1. In the Data window, click the drop-down arrow at the top right of Dimensions, and then select Create > Parameter
  2. In the Create Parameter dialogue box, name the parameter. In the example workbook, the parameter is named Start Date.
  3. Under Data Type, select Date & time.
  4. Under Allowable values, select Range.
  5. Click Set from Field and select the date field. In the example workbook, the date field is named Order Date.
  6. Click OK.
  7. Right-click the Start Date parameter and then select Show Parameter Control.
  8. Repeat steps 1-7 to create the End Date parameter.

Step 2: Create a Date Range Calculation

  1. Right-click Order Date in the Dimensions pane and then select Create > Calculated Field
  2. Name the calculated field Date Range, and type the following in the Formula window, and then click OK:
    [Order Date] >= [Start Date] AND [Order Date] <= [End Date]

Step 3: Add Date Range to Filters

  1. Drag Date Range to Filters, select True, and then click OK.
  2. Right-click Date Range on the Filters shelf, select Apply to Worksheets, and then select All Using this Data Source.

Additional information

To view these steps in action, watch the video below: 
Did this article resolve the issue?