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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
barbforsman
Resolver I
Resolver I

Display 0 and leave blank if null in a matrix

I have a measure that calculates the % of tasks that were completed early or on-time that I display in a matrix by week ending
Pct = ([Early] + [OnTime]) / [Total Tasks]

The problem comes when there is only 1 task in a week and it was late.  This would calculate to 0% for that week, but it does not show in the matrix.  I cannot replace blank or null values with 0, as I only want the field populated if there is data in it.

I have conditional formatting on the value's background color as shown in the screenshot, so I'm confused why it doesn't show the 0 value.

Capture.JPG

 

 

 

 

 

 

How do I make the 0 values show?

TIA

2 ACCEPTED SOLUTIONS
edhans
Super User
Super User

zero values will show. Are you sure they are evaluating to zero, and not blank()? Drop the measure in a regular table and see what it looks like for those records



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

Anonymous
Not applicable

BLANK() / (any number) = BLANK().

From the table can be seen that [Early] = BLANK() and [OnTime] = BLANK(), so their sum is BLANK() as well.

Best
D

View solution in original post

6 REPLIES 6
edhans
Super User
Super User

zero values will show. Are you sure they are evaluating to zero, and not blank()? Drop the measure in a regular table and see what it looks like for those records



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

You are right!  It IS evaluating to blank.  But shouldn't 0/1 = 0 ?  I'm confused by this. How do I edit the measure to account for this?

Capture.JPG

Anonymous
Not applicable

BLANK() / (any number) = BLANK().

From the table can be seen that [Early] = BLANK() and [OnTime] = BLANK(), so their sum is BLANK() as well.

Best
D

Thank you!  I changed the measure to evaluate from total tasks and then it works!

Greg_Deckler
Super User
Super User

image.png


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

There should be an "is blank" option

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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