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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Replacing Blanks with 0 - Adding +0/ new measure not working!

Hello, 

 

I have been trying to replace Blank values as 0 in my matrix visualisation. I have tried using +0 in a new measure and dax functions but no luck. Below is an example of my data and what i am trying to do. Please share your ideas!!

 

DirectionCategoryDate
I117-Jun
B218-Jun
B317-Jun
I118-Jun
I220-Jun
I421-Jun
B519-Jun

EXAMPLE.PNG

I am trying to add values as "0" when the count of category for a specific date is null. 

 

Thanks in advance!

6 REPLIES 6
Anonymous
Not applicable

Adding 0 to a number/measure (like COUNT) always forces the display of a number. ALWAYS. The fact that you can't see 0's in your matrix points in a different direction. I'd check the formatting of the values in the table. Maybe 0's are formatted as BLANKS by the matrix? Can you check some other visuals?

 

Best

Darek

Cmcmahan
Resident Rockstar
Resident Rockstar

What is the measure you are currently using to fill this table?  What measures using the +0 trick have you tried?

Anonymous
Not applicable

Hi @Cmcmahan 

I have used the following dax:

 

count = count([category]) + 0

count = if(isblank(count([category)),0,count([category]))

Child Count = 
VAR rowcount =
    COUNTROWS ( Child )
RETURN
    IF ( rowcount = BLANK (), 0, rowcount )​
count of category = IF(COUNTX(VCCdata,VCCdata[Category]) = 0, 0, COUNT(VCCdata[Category]))
ActualM =
IF (
    CALCULATE ( SUM ( Expenses[Actual] ) ) = BLANK (),
    0,
    CALCULATE ( SUM ( Expenses[Actual] ) )
)

Using your first measure (count = count([category]) + 0), I was able to get this:

snipa.PNG

 

Could you share a screenshot of the fields you have in your Rows/Columns/Values buckets in the visualization pane?

Anonymous
Not applicable

example 1.PNG

 

 

 

 

 

 

 

 

 

 

 

 

I have also used the same measure in the above screenshot. I tried performing the same for various sets of data i have but still end up getting the same. If i am changing count = count([category])+0 to count=count([category])+1, only the fields in the table withvalues get updated and the blank values remain the same. 

Anonymous
Not applicable

[Category Count] = DISTINCTCOUNT( T[Category] ) + 0 

Always use the name of the table in front of the column. ALWAYS. And never do that in front of measures. NEVER.

 

The behavior you're talking about is abnormal. Please restart Power BI.

 

Best

Darek

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 MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.