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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors