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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
v-power
Frequent Visitor

Identifying the "Last updated" column based on two dates

Hello All, 

 

I would like to create a column with flag 1 or 0 based on two date columns. Here is the sample data:

 

KPI NameMonthModified
KPI11/3/20192/6/2019
KPI12/5/20192/5/2019
kpi12/5/20192/6/2019

 

I want to take the max of month first. So in this case, it will be 2/5/2019 with two modified dates, then I have to take the max of modified date. So final output should be something like this:

 

KPI NameMonthModifiedIs Latest
KPI11/3/20192/6/20190
KPI12/5/20192/5/20190
kpi12/5/20192/6/20191

 

Only the last row should be returned. 

 

I tried a couple of dax queries and it doesnt yield the result I want. Can someone help ?

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@v-power 

 

Try this as calculated column

 

IsLatest =
IF (
    AND (
        [Month] = MAX ( [Month] ),
        [Modified]
            = CALCULATE ( MAX ( [Modified] ), FILTER ( Table1, [Month] = MAX ( [Month] ) ) )
    ),
    1,
    0
)

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

@v-power 

 

Try this as calculated column

 

IsLatest =
IF (
    AND (
        [Month] = MAX ( [Month] ),
        [Modified]
            = CALCULATE ( MAX ( [Modified] ), FILTER ( Table1, [Month] = MAX ( [Month] ) ) )
    ),
    1,
    0
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.