Forum Discussion
alwang
2 years agoFrequent Visitor
Bug: Power Query ReplaceValue Bug related to replacing String with null
Hi, I think I have encountered a bug in the ReplaceValue function, where I applied conditional replacinng values: For column [Assessment], I want to do if its value is "N/A", then replace it with...
Ahmedx
Super User
2 years agoyou try changing N/A to null first
= Table.ReplaceValue(Source,"N/A",null,Replacer.ReplaceValue,{"Assessment"})- alwang2 years agoFrequent Visitor
Thanks. I know. But my question is that why my code works one table, but not on this table
- Ahmedx2 years ago
Super User
rewrite the code like this and it will work
= Table.ReplaceValue( #"Changed Type", (x)=>x, (x)=>x , (x,y,z)=> if x = "N/A" then null else if x = "Blouse" or x ="Kosovorotka" then "AAAA" else x,{"Assessment"})