Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacing values based on condition in Power Query

I want to replace some acquaintance values by keywords to specific value, converting both "google" and "searching google" to "seo"

I tried replace but you should specify all the values to replace with and that's not possible. if there is a solution with "contain" function i think it would help but i couldn't find it.

like image 508
Parsa Omidvar Avatar asked Sep 03 '25 02:09

Parsa Omidvar


1 Answers

enter image description here

enter image description here

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Custom1 = Table.TransformColumns( Source, {{"Column1",(x)=> if Text.Contains(x, "google") then "seo" else x}})
in
    Custom1
like image 113
davidebacci Avatar answered Sep 05 '25 21:09

davidebacci