Forum Discussion

sscanlon's avatar
sscanlon
Helper II
4 years ago
Solved

Text Combine Existing Column based on IF Statement from other columns

Hi, searched around and cannot find a way to do the following:    I have a table that has been pieced together from Merging queries, my final step is to Text.Combine the word "Cloud" with a space t...
  • jennratten's avatar
    jennratten
    4 years ago

    You are on the right track again!  Replacer.ReplaceValue is the replacer function.  The replacer function tells Power Query how to perform replacements.  Replacer.ReplaceValue means replace the contents of the entire cell.  To replace subtrings you would use Replacer.ReplaceText.  If you'd like no action to be taken if the criteria is not satisfied then you would refer to the original text [Tags_Cloud].

     

    So...

    = Table.ReplaceValue(#"Added Custom", each [Tags_Cloud], each if [Tags_Cloud] <> null and [Manufacturer] = "Microsoft" then "Cloud " & [ProductClass__c] else [Tags_Cloud], Replacer.ReplaceValue, {"Tags_Cloud"})