Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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 8
Anonymous
Not applicable

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

CVassalotti_0-1597880315551.png

 

danextian
Super User
Super User

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





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

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

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





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

If I extract the data to a CSV and perform the same series of steps it works fine.  but not on my OData source.

@Anonymous that's interesting. You should open a support ticket. I hardly uses/had a chance to use ODAta so cannot help much but this seems to be a bug that it works with one type of data but not other. good luck and post your solution here so that it can help others.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

I don't think I can share the data.

the problem occurs as soon as I pivot

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

CVassalotti_0-1597880968919.png

 

parry2k
Super User
Super User

@Anonymous I think you need to share sample data/screen shots explaining what is not working, very hard to follow from your question what you are trying to solve here?

Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.