KNOWLEDGE BASE

Filtering with the Max() Function


Published: 20 May 2013
Last Modified Date: 30 Dec 2019

Question

When using a calculated field with MAX() in the formula to filter the view, the field may be able to be used on the Filters shelf.

Environment

Tableau Desktop

Answer

Create a LOD calculation. For instance, to filter for Customers whose most recent purchase was on a specific date:

  1. Select Analysis > Create calculated field....
  2. In Name enter Most Recent Purchase and in Formula enter {FIXED [Customer Name]: Max([Order Date])}.
  3. Click OK.
  4. Ensure that Most Recent Purchase is in the Dimensions pane and not the Measures pane.
  5. Drag Most Recent Purchase to the Filters shelf.
  6. Select Month/Day/Year and select Next.
  7. Select the desired day and select OK.

 

Additional Information

  • Tableau Desktop does not support filtering on discrete measures. The field must be a dimension.
  • See attached packaged workbook for example of max(date) on the Filters shelf

Discuss this article... Feedback Forum
Did this article resolve the issue?