Forum Discussion

JoaoMS's avatar
JoaoMS
Helper III
5 years ago
Solved

Replace value in Power Query based on condition

Dear all,   I have a table ("POs") with a list of POs which have some fields that in very specifics moments have wrong entry inputs. For example in the following table the PO "1006" should have the...
  • Anonymous's avatar
    Anonymous
    5 years ago

    HI JoaoMS,

    You can use replace value function with custom expression to add conditions to replace value steps:

        #"Replaced Value" = Table.ReplaceValue(#"Changed Type",each [Category],each if [PO]=1006 and [Category]="D" then "C" else [Category],Replacer.ReplaceText,{"Category"})

    Regards,
    Xiaoxin Sheng