Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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)

  •  

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

1 Reply

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Community Champion

     

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