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
szabooimre
4 years agoNew Member
This is a simpler solution:
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","D",each if [PO]=1006 then "C" else "D",Replacer.ReplaceText,{"Category"})