Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
Based on a condition that a column [Name] contains text "Jonh" i need it to do the following:
Check which words of column [Info] and [Extrainfo] are contained in column [Prod] and remove them.
[Prod] | [Info] | [Extrainfo] | Result |
House Made Of Wood | Made | Of Wood | House |
Any Help? Cant make it work for two columns
Thanks
Solved! Go to Solution.
Hi @Kebas_Leech
This code will do it. I assume the name is meant to be John, rather than Jonh.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8srPyFPSUfLILy1OVfBNTElV8E9TCM/PTwEKgrhACiYQGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Prod = _t, Info = _t, Extrainfo = _t]),
#"Added Custom" = Table.AddColumn(Source, "Result", each if [Name] = "John" then Text.Combine(List.RemoveItems(Text.Split([Prod], " "), Text.Split([Info] & " " & [Extrainfo], " ")), " ") else "0")
in
#"Added Custom"
Regards
Phil
Proud to be a Super User!
Hi
Add new column
if [Name]="Jonh" then Replacer.ReplaceText(Replacer.ReplaceText([Prod],[Extrainfo],""),[Info],"") else [Prod]
Stéphane
Hi @Kebas_Leech
This code will do it. I assume the name is meant to be John, rather than Jonh.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8srPyFPSUfLILy1OVfBNTElV8E9TCM/PTwEKgrhACiYQGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Prod = _t, Info = _t, Extrainfo = _t]),
#"Added Custom" = Table.AddColumn(Source, "Result", each if [Name] = "John" then Text.Combine(List.RemoveItems(Text.Split([Prod], " "), Text.Split([Info] & " " & [Extrainfo], " ")), " ") else "0")
in
#"Added Custom"
Regards
Phil
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
7 | |
7 | |
6 | |
6 |