KNOWLEDGE BASE

Finding the most recent value of a field within a filtered date range


Published: 17 Oct 2017
Last Modified Date: 17 Oct 2017

Question

How to calculate the most recent value of a field within a filtered date range.

Environment

  • Tableau Desktop 9.3.6
  • Windows 7
  • Excel

Answer

Add the [date] filter to context.

Then, the following calculation will find the value of [field of interest] associated with the most recent [date] value for each [ID].

{FIXED [ID] :
MAX (

IF [date] = {FIXED [ID] : MAX ( [date] ) } THEN [field of interest] END

)

}

Additional Information

{FIXED} Level of Detail Expressions ignore Dimension Filters. Therefore, the [date] filter must be added to context.
Did this article resolve the issue?