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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
baby_cabbage
Frequent Visitor

Replacing Blanks with 0 in Power BI Visuals: DAX Measures Not Working

Hello everyone,

I’ve been working with Power BI for several months now, but I’ve never faced an issue as frustrating as this one.

In my visuals, there are cells displaying blanks, and none of my DAX measures to replace those blanks with 0 seem to work. For example, I’ve tried using COALESCE(COUNTROWS(Sheet1), 0) + 0 and IF(ISBLANK(COUNTROWS(Sheet1)), 0, COUNTROWS(Sheet1)), but the blanks persist.


I’ve attached a sample file for reference and would really appreciate it if someone could guide me on resolving this issue. Thank you!


https://drive.google.com/file/d/1PHmj3qBqhn_cKe0Nu4lPeRe1MkEm-N6R/view?usp=sharing

1 ACCEPTED SOLUTION
mark_endicott
Super User
Super User

@baby_cabbage - This is because everything is from the same table, and you're trying to add a 0 into a row that does not exist, so the visual cannot show the 0. 

 

To make this work you need to create a calculated table that stores your dates, a 0 can then be put against this because the date exists in a different table. 

 

In my attached file you will see how I have acheived this. You will also notice that my visual on the left now uses the date from the new table and works, where as the table on the right uses the old date column and the measure does not work as desired.

 

mark_endicott_0-1739463022586.png

If I answered your question please mark my post as the solution, it helps others with the same challenge find the answer!

View solution in original post

4 REPLIES 4
mark_endicott
Super User
Super User

@baby_cabbage - This is because everything is from the same table, and you're trying to add a 0 into a row that does not exist, so the visual cannot show the 0. 

 

To make this work you need to create a calculated table that stores your dates, a 0 can then be put against this because the date exists in a different table. 

 

In my attached file you will see how I have acheived this. You will also notice that my visual on the left now uses the date from the new table and works, where as the table on the right uses the old date column and the measure does not work as desired.

 

mark_endicott_0-1739463022586.png

If I answered your question please mark my post as the solution, it helps others with the same challenge find the answer!

omg this works! Thank you!

Greg_Deckler
Super User
Super User

@baby_cabbage It's almost certainly an auto-exist issue. Go here and do this:

Greg_Deckler_0-1739460137928.png

If you don't see this option, you may need to turn it on in Preview features (because everything is a preview feature now).



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thank you, Greg! I really appreciate your help, but sadly, this didn’t quite solve the issue. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors