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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors