Forum Discussion
Mederic
Post Patron
3 years agoExclude a particular column in the code "if is Null then_"
Hello everyone 😊, I have a table with more than 10 columns, I have the M code below which allows me to replace Null values with 0, However, I would like not to apply on a particular column, in th...
- 3 years ago
Hello - jgordon11 's solution is good if you'd like to specify columns by name. Here is another option since it looks like you are trying to replace nulls with zeros for columns with numeric data. Here is how you can do that.
= Table.ReplaceValue(#"Changed Type", null, 0, Replacer.ReplaceValue, Table.ColumnsOfType(#"Changed Type", {type nullable number}))
jgordon11
Resolver II
3 years ago= Table.ReplaceValue(#"Changed Type", null, 0, Replacer.ReplaceValue, List.RemoveItems(Table.ColumnNames(#"Changed Type"), {"ColumnName4"}))