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
lardo5150
Microsoft Employee
Microsoft Employee

How to show zero for blank in a total count

I have the below matrix

 

totalopen cases.PNG

 

I am pulling from an excel spreadsheet that was exported from our tool.

The spreadsheet lists out engineer and the case number they have that is still open.

I am able to get a total for each engineer, as you can see above.

My problem is for people who do NOT have cases, towards the bottom.

When looking at the data, the cell just says "blank"

 

I tried to transform data and do a replace "blank" with null

I then in my formula tried to use BLANK function:

 

If(ISBLANK(IF(HASONEVALUE('OpenCases'[OwnerEmail]), CALCULATE(COUNT('OpenCases'[ParatureTicketNumber])+0,ALLSELECTED('OpenCases'[OwnerEmail]),'OpenCases'[ParatureTicketNumber]<> 0), BLANK())),0,(IF(HASONEVALUE('OpenCases'[OwnerEmail]), CALCULATE(COUNT('OpenCases'[ParatureTicketNumber])+0,ALLSELECTED('OpenCases'[OwnerEmail]),'OpenCases'[ParatureTicketNumber]<> 0), BLANK())))

 

I get the total for each engineer, but it still thinks that "null" is a value, so it adds a 1 for that engineer, instead of 0.

 

So how do I adjust this, so it is doing what it does right now, getting the total amount of cases per engineer, but then for the ones that have "blank" in the cell (or we can leave it null, whatever), how do I count these as 0 instead of 1.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lardo5150 ,

You can create one measure as below if your table structure is same with the one in below screenshot:

 

Measure = CALCULATE(count('OpenCases'[ParatureTicketNumber])-COUNTBLANK('OpenCases'[ParatureTicketNumber]),ALLEXCEPT('OpenCases','OpenCases'[OwnerEmail]))

 

How to show zero for blank in a total count.JPG

If the above measure is not applicable in your scenario, please provide sample data in table OpenCases (exclude sensitive data).

 

Best Regards

Rena

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @lardo5150 ,

You can create one measure as below if your table structure is same with the one in below screenshot:

 

Measure = CALCULATE(count('OpenCases'[ParatureTicketNumber])-COUNTBLANK('OpenCases'[ParatureTicketNumber]),ALLEXCEPT('OpenCases','OpenCases'[OwnerEmail]))

 

How to show zero for blank in a total count.JPG

If the above measure is not applicable in your scenario, please provide sample data in table OpenCases (exclude sensitive data).

 

Best Regards

Rena

amitchandak
Super User
Super User

One you have add this option

ShowItemwithoutdata.JPG

 

You might have use something like sumx(table, if([value]+0 = 0 ,1,0))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
vivran22
Community Champion
Community Champion

Hello @lardo5150 

 

If you had shared the sample data file, it would have been simpler to provide the solution.

 

I have recreated the data sample for this pupose:

data sample.PNG

 

Created the following meausres after replacing "blank" with null is Power Query:

 

Count Tickets = COUNTA(dtTickets[Case#]) - COUNTBLANK(dtTickets[Case#])

Open Tickets = CALCULATE([Count Tickets],KEEPFILTERS(dtTickets[Status] = "Open"))

 

Getting the following result

 

Capture.PNG

Cheers!
Vivek

If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Connect on LinkedIn

 

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.