KNOWLEDGE BASE

Filtering to the Most Recent Date


Published: 12 Jun 2013
Last Modified Date: 13 Jun 2018

Question

How to filter the view to always show data for the most recent date in the data set.

Environment

Tableau Desktop

Answer

Option 1

Upgrade to Tableau Desktop 10.3 to take advantage of the Lastest Date Preset feature. See Upgrade Tableau Desktop for more information about upgrading.

Option 2

  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 3 (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.

Option 4 

  1. Drag the date field (for example Order Date) from the Dimensions pane to the Filters shelf.
  2. In the Filter Field dialog box, select the desired discrete date part. For example, to display only the latest month, select Month / Year, and then click Next >
  3. In the Filter dialog box, click the Top tab, and then select By Field.
  4. Under By Field, select Top and enter 1.
  5. Then select Order Date and Maximum from the drop-down menus and click OK.
Note: A discrete date must be selected. For more information, see Continuous and Discrete. When selecting a date part, be sure to include higher levels in the date hierarchy. For example, to filter out all but the latest day, select Month / Day / Year instead of just Days.

Additional Information

To view Options 2 and 3 in action, see the video below: 
Did this article resolve the issue?