Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 null, if its value is ..., then .... But I noticed that replacing "N/A" with null doesn't work. It works if I replace "N/A" with any other values. This is so strange. But make it even more strange, the same code works on another data table!
1st screenshot is the step before the replaceValue, and 2nd is the ReplaceValue step, and 3rd screenshot is when I change null to "test". You can see that only when I use if [Assessment]= "N/A" then null it doesn't work.
anyone can pin down a coding error? or it's really a Power Query bug?
Thanks
you try changing N/A to null first
= Table.ReplaceValue(Source,"N/A",null,Replacer.ReplaceValue,{"Assessment"})
Thanks. I know. But my question is that why my code works one table, but not on this table
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"})
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 64 | |
| 43 | |
| 41 | |
| 32 | |
| 22 |
| User | Count |
|---|---|
| 200 | |
| 126 | |
| 103 | |
| 71 | |
| 54 |