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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Need help to create custom column

Hi Team,

 

Could you please me to create custom column for below sample data:

Logic:  need to update the same status for duplicate domains based on latest notification date.

Example: Domain A, have duplicate records, based on latest date(13/8/2019) , need to create custom column(Result) to update the status.

Capture.PNG

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous,

You can write a variable to lookup the latest date based on current domain, then you can simply use current domain and latest date variable to find out the last status.

column =
VAR _lastdate =
    CALCULATE (
        MAX ( Table[Date] ),
        FILTER ( Table, [Domain] = EARLIER ( Table[Domain] ) )
    )
RETURN
    CALCULATE (
        MAX ( Table[Status] ),
        FILTER ( Table, [Domain] = EARLIER ( Table[Domain] ) && [Date] = _lastdate )
    )

Regards,

Xiaoxin Sheng

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous,

You can write a variable to lookup the latest date based on current domain, then you can simply use current domain and latest date variable to find out the last status.

column =
VAR _lastdate =
    CALCULATE (
        MAX ( Table[Date] ),
        FILTER ( Table, [Domain] = EARLIER ( Table[Domain] ) )
    )
RETURN
    CALCULATE (
        MAX ( Table[Status] ),
        FILTER ( Table, [Domain] = EARLIER ( Table[Domain] ) && [Date] = _lastdate )
    )

Regards,

Xiaoxin Sheng

 

Anonymous
Not applicable

Hi @Anonymous 
try this
 
Column =

var max_date__=calculate(max('Table'[date]),ALLEXCEPT('Table','Table'[Domain]))
return
LOOKUPVALUE('Table'[Status],'Table'[Date],max_date__)
 
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.