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
bdehning
Post Prodigy
Post Prodigy

Getting a 0 and not blank

I have the following measure but some rows return a blank instead of a 0 if there were no results?

 

Claim Count Open = CALCULATE(COUNT(LossRunToExcel[Claim Number]),LossRunToExcel[Claim Status] <> "Closed")

 

Is there a way to introduce "0" if there is no count for a row?

2 ACCEPTED SOLUTIONS
samdthompson
Memorable Member
Memorable Member

Hello, something like this should fix it:

=CALCULATE(COUNT(LossRunToExcel[Claim Number]),LossRunToExcel[Claim Status] <> "Closed")+0

 

cheers,

// if this is a solution please mark as such. Kudos always appreciated.

View solution in original post

JasserBI
Frequent Visitor

Hello bdehing,

 

Try with COALESCE formula. It should solve it by giving a "0" in case there is not data. For your case, the final formula would be:

 

Claim Count Open = COALESCE(CALCULATE(COUNT(LossRunToExcel[Claim Number]),LossRunToExcel[Claim Status] <> "Closed"),0)

View solution in original post

4 REPLIES 4
JasserBI
Frequent Visitor

Hello bdehing,

 

Try with COALESCE formula. It should solve it by giving a "0" in case there is not data. For your case, the final formula would be:

 

Claim Count Open = COALESCE(CALCULATE(COUNT(LossRunToExcel[Claim Number]),LossRunToExcel[Claim Status] <> "Closed"),0)

Thank you.  What if I need to do the same thing for Conditional or Custom Columns, if there is no measure involved.  

Hello @bdehning,

 

In that case there would be still a DAX expression so you could apply them too. In the case of Conditional columns, one option would be to apply the condition for all of them being " " to change to 0 value. For custom columns the same.

samdthompson
Memorable Member
Memorable Member

Hello, something like this should fix it:

=CALCULATE(COUNT(LossRunToExcel[Claim Number]),LossRunToExcel[Claim Status] <> "Closed")+0

 

cheers,

// if this is a solution please mark as such. Kudos always appreciated.

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.