KNOWLEDGE BASE

Filtering to the Single Most Recent Date


Published: 12 Jun 2013
Last Modified Date: 08 Mar 2019

Question

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

Environment

Tableau Desktop

Answer

Option 1 (Tableau Desktop 10.3 and newer versions)

Use the Latest Date Preset feature. Unlike the additional options listed below, this option will allow for the use of the filters card to select additional dates.

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.
Did this article resolve the issue?