Forum Discussion
mariomaraucci
4 years agoNew Member
Power Query - Replace values based on another table's data
Hi, I am new to the Power Query world and this community 🙂 I'm struggling with a task - I have a table "All_Skills" that contains 2 columns like this: Skill Center Licensing Other B...
- 4 years ago
Hello - this makes perfect sense. Please have a look at the attached example, which demonstrates how to use a mapping table to perform multiple replaces in other tables.
- 4 years ago
Use a custom column and put following formula there
= Text.Combine(List.Transform(Text.Split([Interaction],">"),(x)=>try All_Skills{[Skill=Text.Trim(x)]}[Center] otherwise null)," > ")See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8slMTs0rzsxLV4gpNTAwTj20wCkzJwfE98wrLM0sykwthssEJFbmpuaVKKSk5mWmpijF6kQr4Vbsk1hQkl+gUJRakJOYnArSB9bgk5lXWqFQXFpQkF9UgldxLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Interaction = _t]), #"Added Custom" = Table.AddColumn(Source, "Interactions_Center", each Text.Combine(List.Transform(Text.Split([Interaction],">"),(x)=>try All_Skills{[Skill=Text.Trim(x)]}[Center] otherwise null)," > ")) in #"Added Custom"
jennratten
4 years agoSuper User
Hello - this makes perfect sense. Please have a look at the attached example, which demonstrates how to use a mapping table to perform multiple replaces in other tables.
- mariomaraucci4 years agoNew Member
This is brilliant! It also just initiated myself to Power BI, so far I was only working in Power Query 😃
Thank you very much!