Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to replace a string value if another string value exists in the cell ?

Hello,   How to replace a string value if another string value is present in the cell? example :   Data = aaa bbb ccc ddd eee fff   I'm looking to replace only "eee" with "xxx-eee", only if "bb...
  • Greg_Deckler's avatar
    3 years ago

    Anonymous Well, in DAX that is simply:

    Column = IF(SEARcH("bbb", [Column1],,0)>1,SUBSTITUTE([Column1],"eee","xxx-eee"),[Column1])

    Let me see if I can figure out the Power Query.