Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

lookup value and replace value on ecolumn power Query

Hello,

 

I am trying to reclass/replace values in Table A column GTIN based on what is stated in Table B column GTIN.NEW

I am loading some data (500.00 rows and 10 columns to power bi) in Table A and Table B has 2 columns and a few rows.

In example this is what table a looks like:

 

ProductnameGTINValueVolume
Bikes1231001
Cars4563001

 

This is my data table A.

Now I have a second table B which has to columns:

GTINGTIN.NEW
123111
456222

 

I know i could do this after loading all the data and create a calculated column and use the lookupvalue function but is there a way to do this before loading the data into the model using power query? Would you recommend it in terms of performance?

 

Kr 🙂

 

  • Anonymous 

    It will still work. You will get null for rows where the GTINs values do not coincide. You can the create a new conditional column to select either the new or the old value, and finally delete the previous GTIN columns

5 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Icon for Community Champion rankCommunity Champion

    Anonymous 

    From the sound of it you could merge both tables in Power Query by linking the GTIN columns. 
    Then delete the old GTIN column once the merge table is created

    • Anonymous's avatar
      Anonymous
      Not applicable

      PaulDBrown that would only work if table B has the same GTIN entries as table A, or?

      • PaulDBrown's avatar
        PaulDBrown
        Icon for Community Champion rankCommunity Champion

        Anonymous 

        It will still work. You will get null for rows where the GTINs values do not coincide. You can the create a new conditional column to select either the new or the old value, and finally delete the previous GTIN columns

  • Anonymous's avatar
    Anonymous
    Not applicable

    I might add that table B does not have the same amount of entries ass Table A. Table B only consists of the GTINs that need to be changed