7 Replies Latest reply on Feb 8, 2016 1:06 AM by rohail khan

# Filter to return Max Date

Trying to create a filter that will return all rows of the latest date. More context: If John took 5 trips in one year, he will have 5 rows with different dates. I want one row for John that represents the latest date, or most recent trip. How would I go about creating this filter for multiple people?

Thanks!

• ###### 1. Re: Filter to return Max Date

Hi Sam,

LOD calc filter or last()=0 table calc filter depending on how you present your data:

Here's LOD approach:

Date Filter:

{FIXED [Person]: max([Trip Date])} = [Trip Date]

Place on filters set to true

(Before Filter)

(After Filter)

• ###### 2. Re: Filter to return Max Date

The reason why I prefer the LOD approach is that you only need to have the Person field on the detail.  Date does not need to be present.

So like in this example I have measures associated to those dates (Field labeled Value)

You can show just those records (without needing the date field on the view)

• ###### 3. Re: Filter to return Max Date

Thank you so much Aaron. The calculation returns an error: “Level of detail expressions are not supported by the datasource”. Do you know of a solution to this problem?

• ###### 4. Re: Filter to return Max Date

You'll need to extract your data in order to use LoD calc's.

• ###### 5. Re: Filter to return Max Date

can you please tell me how i can perform this formula is tableau desktop (Audit Type = Update if Type = 'U', Delete if Type = 'D', Insert Type = 'I', )

• ###### 6. Re: Filter to return Max Date

can you please tell me how i can perform this formula is tableau desktop (Audit Type = Update if Type = 'U', Delete if Type = 'D', Insert Type = 'I', )