Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

we cannot replace value null to type text

Looking for a simple solution

I am pivoting a table to create a column for each value

= Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Status]), "Status", "Count")

it is returning some null values, which I want to convert to Zeros so they will work properly in Averages in a Matrix

So I trieds using replace values null with 0 and it seems to work fine until I try to apply the changes.

The columsn it creates are called Availalbe, Implemented, In Flight, and Roadmap.

 

Any ideas?

8 Replies

  • Hi Anonymous 


    Did a test and replacing null in a column that is type number with zero works fine. The formula looks like this Table.ReplaceValue(#"PreviousStep",null,0,Replacer.ReplaceValue,{"Number"})

    Try converting your number column to type text first, do a replace and convert it back to number after.  Alternatively, you may create a custom column with a formula similar to this if [Column] = null then 0 else [Column] and then delete the original column

    • Anonymous's avatar
      Anonymous
      Not applicable

      thanks, I tried both of these approached and neither worked.

      • danextian's avatar
        danextian
        Super User

        Anonymous , Are you able to attached your pbix with the data source?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Here is a screen shot. once pivoted, I can't get the nulls replaced with zeros to save back