Forum Discussion

Mederic's avatar
Mederic
Icon for Post Patron rankPost Patron
3 years ago
Solved

Exclude 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...
  • jennratten's avatar
    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}))