Forum Discussion

lc881's avatar
lc881
Frequent Visitor
4 years ago
Solved

Extract Text after delimiter while igoring repeated words based on Owner ID column

I have data like the table below: Owner ID Pet Description [Desired Output] 123 Dog Light Brown Light Brown 123 Dog Dark shade of Green Dark shade of Green 123 ...
  • davehus's avatar
    4 years ago

    Hi lc881 ,

     

    In power query, create a custom column and use the formula below.

     

    if Text.Contains([Pet Description], "Dog") then Text.Replace([Pet Description],"Dog","") else if Text.Contains([Pet Description], "House Cat") then Text.Replace([Pet Description],"House Cat","") else ""

     

    Then trim and clean the column. You can build it up as desired with your pet name variations.

     

    HTH