Forum Discussion

Ericwhv's avatar
Ericwhv
Helper II
5 years ago
Solved

Power BI vlookup?

Thank you everyone!

i have two table

Table 1 which is showing the date

POOMB RefDate
922583377BQ74025419/03/2021
922583814BQ74151017/03/2021
922583379BQ82280010/03/2021
922582943BQ82280010/03/2021
922583215BQ82305010/03/2021
922582880BQ82305010/03/2021
922582943BQ82305010/03/2021
922582943BQ82305010/03/2021
922582895BQ82305010/03/2021
922582895BQ82305010/03/2021

Table 2 which do you have the date

Booking Number (BK)PO Num
BQ740254922583377
BQ741510922583814
BQ822800922582943
BQ822800922583379
BQ823050922582880
BQ823050922582895
BQ823050922582943
BQ823050922583215

 

in Excel, we could do a vlookup to find out the first result and put the date into Table 2, but power BI, how can we do that?

the result i want to see is. .... 

Table two

Booking Number (BK)PO Numdata by Vlookup
BQ74025492258337712/04/2021
BQ74151092258381407/04/2021
BQ82280092258294314/04/2021
BQ82280092258337914/04/2021
BQ82305092258288007/04/2021
BQ82305092258289507/04/2021
BQ82305092258294307/04/2021
BQ82305092258321507/04/2021

 

i try to use "Related" function, but Related function is just for one to one relationship, instead of the "many to many"

thank you!

  • Hi Ericwhv 

    Best in PQ but if you want it in DAX:

    NewCol =
    LOOKUPVALUE ( Table1[Date], Table1[PO], Table2[PO Num] )
    

     

    Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

     

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Ericwhv,

    In fact, you can use lookupvalue function to direct lookup other table field values if they existed related fields(e.g. table1 'id', table2 'id', you can use table1 'id' as key to search table2 other field values) even if you not link these tables with relationships.

    Introducing LOOKUPVALUE - SQLBI

    Regards,

    Xiaoxin Sheng

3 Replies

  • AlB's avatar
    AlB
    Community Champion

    Hi Ericwhv 

    Best in PQ but if you want it in DAX:

    NewCol =
    LOOKUPVALUE ( Table1[Date], Table1[PO], Table2[PO Num] )
    

     

    Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Ericwhv,

    In fact, you can use lookupvalue function to direct lookup other table field values if they existed related fields(e.g. table1 'id', table2 'id', you can use table1 'id' as key to search table2 other field values) even if you not link these tables with relationships.

    Introducing LOOKUPVALUE - SQLBI

    Regards,

    Xiaoxin Sheng