Forum Discussion

majdkaid22's avatar
majdkaid22
Helper V
10 years ago
Solved

Lookup Value two tables

Hi Community,   am trying to find something similar to Vlookup to apply on 2 tables in power bi.   I have one table (meaccount) which has unique  values for every client, and I have table (meacco...
  • konstantinos's avatar
    10 years ago

    majdkaid22 kcantor Merge queries is easiest way but probably will return multiple rows ( since  we matching values from many to one ) so then remove duplicates on ID and good to go.

     

    You can try with DAX also in case you have a column in meAccountHistory , like date or transaction ID that defines the latest record. 

     

    Create a calculated column :

     

    BringCountry = LASTNONBLANK(meAccountHistory[IsoCountry];MAX(meAccountHistory[Date]))
    
    or
    
    LASTNONBLANK(meAccountHistory[IsoCountry];MAX(meAccountHistory[TransactionID])) 
    
    

    This way you avoid returning multiple values. 

     

    Be careful though that it will bring the latest IsoCountry so if an account change country it will show him as the latest country. Of cource if you use filter from meAccount table.

     

    Hope that helps.