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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
dschul365
New Member

Finding Latest Date using Multiple Criteria with Multiple Entries for Unique IDs

Hello, I am looking for some assistance with finding the latest date for both On and Off times for each ID where there can be mulitple records of both Types for each ID.  

 

DateTypeIDLatest On TimeLatest Off Time
1/1/22 12:15on1  
1/2/22 12:30on1  
1/4/22 16:15off1  
1/2/22 18:15off1  
1/5/22 12:15on2  
1/6/22 12:15off2  
1/7/22 12:15on2  
1/8/22 12:15on3  
1/9/22 12:15on3  
1/10/22 12:15on4  
1/11/22 12:15off4  
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @dschul365 

please try

Latest On Time =
MAXX (
FILTER (
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[ID] ) ),
'Table'[Type] = "on"
),
'Table'[Date]
)

View solution in original post

4 REPLIES 4
dschul365
New Member

You are correct, the latest date values are now populating. Thank you for the assist! 

 

tamerj1
Super User
Super User

Hi @dschul365 

please try

Latest On Time =
MAXX (
FILTER (
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[ID] ) ),
'Table'[Type] = "on"
),
'Table'[Date]
)

Hello @tamerj1 

 

Unfortunately, once applied this formula only returns blank values within the Latest On Time column. Could you explain how the ALLEXCEPT forumla is intened to work here? 

@dschul365 

The CALCULATETABLE  with ALLEXCEPT should return the complete table of the current ID. This should work if Type is a column rather than a measure. Is it?

aslo please try

Latest On Time =
MAXX (
FILTER (
CALCULATETABLE ( 'Table', REMOVEFILTERS (), VALUES ( 'Table'[ID] ) ),
'Table'[Type] = "on"
),
'Table'[Date]
)

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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