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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
kathraji
Frequent Visitor

DAX Get latest value with from other tableau based on condition

Hi Everyone,

 

I've two tables A and B with the following data.I'm trying to have one table with the latest value fr code'0' for each name

 

Table A

namecode
name11
name21
name31

 

TableB

namecodeupdated_at
name1010/12/2017
name1015/12/2017
name2007/1/2020
name2025/1/2020
name3019/04/2020

 

The resulting table should like this

namecodeupdated_at
name11 
name1015/12/2017
name21 
name2025/1/2020
name31 
name3019/04/2020

 

Please help.

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @kathraji ,

 

It is a slight modification of amitchandak‘s reply:

 

Table =
UNION (
    SUMMARIZE (
        TableB,
        TableB[name],
        TableB[code],
        "updated_at", MAX ( TableB[updated_at] )
    ),
    ADDCOLUMNS ( TableA, "updated_at", BLANK () )
)

 

 

Capture2.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

View solution in original post

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hi @kathraji ,

 

It is a slight modification of amitchandak‘s reply:

 

Table =
UNION (
    SUMMARIZE (
        TableB,
        TableB[name],
        TableB[code],
        "updated_at", MAX ( TableB[updated_at] )
    ),
    ADDCOLUMNS ( TableA, "updated_at", BLANK () )
)

 

 

Capture2.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@kathraji , see if this can work

union (
summarize(Table2, Table[name code],"updated_at" , max(updated_at)),
addcolumns(Table A,"updated_at" ,blank())
)

 

refer

https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors