cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
v-power Frequent Visitor
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

Accepted Solutions
Super User
Super User

Re: Identifying the "Last updated" column based on two dates

@v-power 

 

Try this as calculated column

 

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

Re: Identifying the "Last updated" column based on two dates

@v-power 

 

Try this as calculated column

 

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