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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
K3ph4s
Regular Visitor

Replace Value in Query Editor for value of another table

Hi Community,
i would need you help.
i have a data in a "column1" of a "table A" with different values 

K3ph4s_0-1726655113438.png

i would need to replace this values between "" Column1 for the value related to this code "column2" from another "Table B":

K3ph4s_3-1726655276800.png

 

 

 

So in table A Column 1 will appear the name of "column 2" of Table B rather than de code

 

Anyone can help me?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @K3ph4s ,

 

Thanks Shivu-2000  for the quick reply. I would like to add another thought:

You can create a custom column in Power Query.

 

List.Accumulate(List.Numbers(0,Table.RowCount(#"Table B"),1),[Column1],(x,y)=>Text.Replace(x,#"Table B"[Column1]{y},#"Table B"[Column2]{y}))

 

vtangjiemsft_0-1726732005840.png

 

Best Regards,

Neeko Tang

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

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file.  Show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @K3ph4s ,

 

Thanks Shivu-2000  for the quick reply. I would like to add another thought:

You can create a custom column in Power Query.

 

List.Accumulate(List.Numbers(0,Table.RowCount(#"Table B"),1),[Column1],(x,y)=>Text.Replace(x,#"Table B"[Column1]{y},#"Table B"[Column2]{y}))

 

vtangjiemsft_0-1726732005840.png

 

Best Regards,

Neeko Tang

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

@Anonymous  Thanks for the response; one main question: Are figures 0 and 1 the position of the columns in the tables?
i reviewing your file.... as it is simple with those two columns only, however my table contian such as 30 columns and the data is not in columns 1 or 2.

Regards

Anonymous
Not applicable

Hi @K3ph4s ,

 

It refers to the position of the row in which a particular column is located. It is related to the column name, not the first column.

Please refer: 

List.Numbers - PowerQuery M | Microsoft Learn

Table.RowCount - PowerQuery M | Microsoft Learn

 

You mentioned that you have a total of 30 columns, would you like to replace all of them? Then you can merge these columns into one column using commas and add this custom column so that you can replace them together and then split all the columns according to the commas.

 

Best Regards,

Neeko Tang

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

Shivu-2000
Super User
Super User

Hi @K3ph4s 

This ticket is similiar to yours, this might be helpful

https://community.fabric.microsoft.com/t5/Desktop/Power-BI-vlookup/td-p/1830713

 

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

It is similar but the huge differences is that in my case there are some values in the same cell, divided by a coma or "

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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