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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
rpinxt
Solution Sage
Solution Sage

Strange behaviour when I want to show blank as 0

I have this visual :

rpinxt_0-1699975218628.png

As you see the IFU InvQ is blank. It is a simple sum formula.

So I wanted it to show as 0 as follows :

rpinxt_1-1699975273407.png

Whats going on here?

Why do I get hundreds of lines showing 0?

 

Has it to do with the tables being connected as many to many?

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@rpinxt Try this:

Test = IF( ISBLANK( [DelQ] ), BLANK(), SUM('IFU Inventory'[Total Qty]) + 0 )

When you return a 0 then every combination will return that 0 which means that everything shows up in the matrix or visual.



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...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@rpinxt Try this:

Test = IF( ISBLANK( [DelQ] ), BLANK(), SUM('IFU Inventory'[Total Qty]) + 0 )

When you return a 0 then every combination will return that 0 which means that everything shows up in the matrix or visual.



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...

Thanks @Greg_Deckler !

This indeed seems to do the trick:

rpinxt_0-1700032999021.png

Seems to be working in all situation where IFU InvQ is filled, blank or zero.

Bit puzzeled as to why DelQ is involved as this should not be empty anyway.

But do understand what you say about when it brings in a zero it will bring in a zero for al combinations and then the visual will also show all the combinations.

 

@rpinxt Right, you have the concept. The specifics of how to "fix" it will vary depending on the situation, I was just trying to puzzle out a potential fix given the information you provided, the real fix may vary depending on your data and use case.



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...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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