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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
iKiok
Frequent Visitor

Power Query - (M code) - replace text in a column with values from a column in another query

Greetings to all,

 

I would like to replace many individual values in a column with values that exist in another query.

 

I cannot merge since I would like it to be a "text contains" replacement.

 

Any help with the correct "table[column]" reference to the other query would be appreciated

 

= Table.ReplaceValue(#"Renamed Columns",Replacements[original],(Replacements[replacement],Replacer.ReplaceText,{"Activity"})

4 REPLIES 4
Mariusz
Community Champion
Community Champion

Hi @iKiok 

Can you provide a data sample?

Thanks
Mariusz

iKiok
Frequent Visitor

@Mariusz here is the data in 2 queries. Normally I would run 20 steps of "Replace Value", so now I am looking to make it happen a bit faster and easier

 

Column where values need to be replacedColumn where values need to be replacedReplacements TableReplacements Table

Mariusz
Community Champion
Community Champion

Hi @iKiok,

is there any chance you could prepare a sample of data that preserves the logic of your data and is easy to copy and work with?

Many Thanks

Mariusz

iKiok
Frequent Visitor

@Mariusz 

 

https://makiosgr-my.sharepoint.com/:x:/g/personal/ikiokpas_makios_gr/EdYzUDAZuL9Dmh3ifrvtGSEByAL5fAA...

 

so, Query Logs - Column Activity, normally i would run 17 steps to replace (text contains) text from Activity Column with other text.

 

now I have created another Table (Query - Replacements) and I would like to do the replacements with something like

 

= Table.ReplaceValue(#"Renamed Columns", each Replacements[original],each(Replacements[replacement],Replacer.ReplaceText,{"Activity"})

 

meaning that I would like to read the column from the other query and do the replacements in the Log query.

 

Is that possible (reading a column from another query)? 

If yes, could you please help me with the syntax?

 

thank you in advance

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.