Forum Discussion
JoaoMS
5 years agoHelper III
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...
- Anonymous5 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
Anonymous
5 years agoNot applicable
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
JoaoMS
5 years agoHelper III
Thank you, this is what I was looking for without creating a new column. I just made a small change "each if [PO]=1006 then "C" else [Category]", considering that there is just one PO named "1006" Regards