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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sid-poly
Helper I
Helper I

Replace Specific Text in a Column Based on Other Entire Column Values

Col ACol B
ABXX-TX-AB
CDCD-TX-AB
EFEF-EF-IL
GHIL-GH-XX
IJXX-IJ-XX

 

 

In the Above table there is Col A and Col B. The task is to remove all the values present in Col B based on the Values in the Entire Col A. The above table should look like


Col ACol B
ABXX-TX-
CD-TX-
EF--IL
GHIL--XX
IJXX--XX

 

Can anyomne simplify a Power Query M formula. As There has been multiple tries regards the same but the only method that is observed is using replace values but Col A consists of more than 100 values and it is difficult to get through each column, so need to take values from entire column and see if any value exists in Col B then replace it with ""(Blank)

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1675753563750.png

 

= Table.TransformColumns(Source,{"Col B",each Text.Combine(Splitter.SplitTextByAnyDelimiter(Source[Col A])(_))})

View solution in original post

1 REPLY 1
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1675753563750.png

 

= Table.TransformColumns(Source,{"Col B",each Text.Combine(Splitter.SplitTextByAnyDelimiter(Source[Col A])(_))})

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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