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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sarah2_williams
Helper III
Helper III

Linking old names to new names over YoY analysis with a lookup

Hi all,

 

I have some yearly sales data where between one year sales and another the coding of the product has changed. I have attached an example of what I have been given, one tab is the sales data itself, the other is a lookup which relates the old product code to the new product code.

 

I need to somehow link the old codes to the new codes using the lookup, so that all years appear in a graph/table, with the products linked together. 

 

We know from the lookup that Old Product "1111" is the same as New Product "111" but I can't work out how to get this all together so that my graph will include all 3 years.

 

I have though that if this was excel I would do a Vlookup, giving previous years the new code so I could just use the "New Code" column but that doesn't seem possible in PowerBI? my data has nearly 9 million rows.

 

https://1drv.ms/x/s!AgqFHfAlcE6nhnkazp_0PpOiM3Qo?e=XEiPwm very basic example file here.

 

Thanks

Sarah

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sarah2_williams  use the lookupvalue function to achieve this.

 

Import the lookuptable in BI and on your original table use loolupvalue(new code,old code, old code(main table)), this would bring in the new codes in front of the old ones and you would be able to run the analysis.

 

Kindly mark this as solutiom as accepted.

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @sarah2_williams ,

Here are the steps you can follow:

1. Select Home – Append Queries - Append Queries as New in power query

v-yangliu-msft_0-1614559130599.png

2. Select Replace Values to convert the N/A of the two columns to Blank

v-yangliu-msft_1-1614559130605.png

3. Select the two columns to be merged, select Merge Columns in Add Column

v-yangliu-msft_2-1614559130609.png

4. Result.

v-yangliu-msft_3-1614559130611.png

 

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Hi @sarah2_williams  use the lookupvalue function to achieve this.

 

Import the lookuptable in BI and on your original table use loolupvalue(new code,old code, old code(main table)), this would bring in the new codes in front of the old ones and you would be able to run the analysis.

 

Kindly mark this as solutiom as accepted.

This did not work for me. it will not let me add in the last reference on the main table. new code and old code in the lookup are whole numbers, as is the old code in the main table. do you know why it would not let me select the final column reference?

 

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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