KNOWLEDGE BASE

Setting Default Date to Most Recent Date on a Filter


Published: 12 Jun 2013
Last Modified Date: 18 Jan 2017

Question

How to set the default date in a filter to the most recent date in the data set. 

Environment

Tableau Desktop

Answer

Use this method when the most recent date in the data set is not the current date. Otherwise, use relative date filters.

Option 1: 

  1. Select Analysis > Create Calculated Field.
  2. In the Calculated Field dialog box that opens, enter a name for the field.
  3. In the formula field, create a calculated field similar to the following:
    	[Order Date] = {FIXED : MAX([Order Date])}
    
  4. Drag the newly created calculated field from the Measures pane to the Filter shelf.
  5. In the Filter dialog box that opens, select True, and then click OK.
 

Option 2 (if LOD calculations are not possible):

  1. Select Analysis > Create Calculated Field.
  2. In the Calculated Field dialog box that opens, enter a name for the field.
  3. In the formula field, create a calculated field similar to the following and click OK:
    	IF MAX([Order Date])=WINDOW_MAX(MAX([Order Date])) 
    	THEN 'Max Date' 
    	ELSE 'Other'  
    	END
    
  4. Drag the newly created calculated field from the Measures pane to the Filter shelf.
  5. In the Filter dialog box that opens, select max date, and then click OK.

Additional Information

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