Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ats1958
Helper II
Helper II

Filter to Most Recent TimeStamp

I'm using an Azure SQL DirectQuery dataset and I'd like to add a filter to only show data for the most recent timestamp. There will be multiple rows for a given timestamp. Any way to do this with DAX? I'd like to avoid making changes to my database and application if at all possible.

 

This is what I'm using, but it's a measure so I can't use it as a filter. And I can't use the MAX function in a calculated column.

 

 

Latest1 = IF(MAX(Query1[timestamp]) = CALCULATE(MAX(Query1[timestamp]), ALL(Query1[timestamp])),
    "Latest", "")

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@ats1958,

 

You may drag the measure to Visual level filters.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@ats1958,

 

You may drag the measure to Visual level filters.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
alexei7
Continued Contributor
Continued Contributor

Hi @ats1958,

 

Why can't you use MAX in a calculate column?

 

The following works for me:

 

IsDateLatest = if(Dates[Dates]=MAX(Dates[Dates]),"Latest","") 

Hope that helps

Alex

Anonymous
Not applicable

HI Alex, your solution was perfect. Howver I got another question. What if have to apply he time stamp filter for individul items in the data. For ex : we have multiple applications and each of them are scanning different time. Hence we need to filter data for respective application based on their most recent timestamp. 

 

Please advise.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.