Forum Discussion
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:
| Productname | GTIN | Value | Volume |
| Bikes | 123 | 100 | 1 |
| Cars | 456 | 300 | 1 |
This is my data table A.
Now I have a second table B which has to columns:
| GTIN | GTIN.NEW |
| 123 | 111 |
| 456 | 222 |
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
Community 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- AnonymousNot applicable
PaulDBrown that would only work if table B has the same GTIN entries as table A, or?
- PaulDBrown
Community 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
- AnonymousNot 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