Forum Discussion
Anonymous
5 years agoNot applicable
Replace NaN with blanks in Power Query
I am importing data from an excel sheet where many cells contain NaN values. How can I replace these NaN values with blanks or null in PowerQuery? The Replace Values function does not appea...
- 5 years ago
There is a function for that. You can apply any mathematical transform to that column, and then adapt the code in the formula bar using the Number.IsNaN() function like this.
= Table.TransformColumns(#"Added Custom", {{"Custom", each if Number.IsNaN(_) then null else _, type number}})
Regards,
Pat
mahoneypat
5 years agoMicrosoft Employee
There is a function for that. You can apply any mathematical transform to that column, and then adapt the code in the formula bar using the Number.IsNaN() function like this.
= Table.TransformColumns(#"Added Custom", {{"Custom", each if Number.IsNaN(_) then null else _, type number}})
Regards,
Pat
- Anonymous5 years agoNot applicable
Perfect, thanks. Extra question: is there a simple way to apply this transformation to multiple columns in a one-line command?