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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors