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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Theresaz
New Member

Checking if the date & time is the latest while filtering by column

I have the following scenario: a table of product data that has a "updated time" column. The most useful info for current status reports is obviously the latest, so I'm thinking of including the calculated column "is latest" as shown below

Product IDQtyUpdated timeIs latest
00151/12/2023 10:00 AM1
00241/12/2023 11:00 AM1
00121/12/2023 9:00 AM0

 

The problem is, when I attempt to calculate the Is latest value with a simple IF(Updated time = MAX(Updated time),1,0) it will compare the Updated time from Product 001 with the Updated time from Product 002, so it will only mark with a "1" the most recently updated product.
Is there a way to include a filter by Product ID in the formula? I've tried a couple of things but I can't find a way to filter the calculation by the ID without specifying an ID in particular.
Any help would be appreciated!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Theresaz 
Please try

Is Latest =
IF (
    'Table'[Updated time]
        = CALCULATE (
            MAX ( 'Table'[Updated time] ),
            ALLEXCEPT (
                'Table',
                'Table'[Product ID]
            )
        ),
    1
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @Theresaz 
Please try

Is Latest =
IF (
    'Table'[Updated time]
        = CALCULATE (
            MAX ( 'Table'[Updated time] ),
            ALLEXCEPT (
                'Table',
                'Table'[Product ID]
            )
        ),
    1
)
sebouier
Frequent Visitor

To get the "Updated time maximum" by "Product", try this DAX formula: 

 

 

IF([Updated time] = CALCULATE(MAX([Updated time]), ALLEXCEPT('Your table',[Product]),1,0)

 

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.