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
Anonymous
Not applicable

SUMX and COUNTAX Zeros

I'm trying to get consistent blank or zeros in the matrix below.  As shown below, # SLA Met, # SLA Breach show zeros but Excep shows blanks.

 

Below are the measures I am using:

 

# SLA Met=

SUMX(task_sla,[RAW - Count SLA Met] + [Breach Exceptions])

 

# SLA Breach=

SUMX(task_sla,[RAW - Count SLA Breach]) - SUMX(task_sla,[Breach Exceptions])

 

Excep= COUNTAX(task_sla,task_sla[dv_u_breach_code])

aaragon0902_2-1675809020064.png

 

I would like to show zeros in the Excep column where there are blanks.  I have tried adding + 0 at the end but then it shows ALL Region/SLA/INC#, even those that have zero # SLA Met and # SLA Breach. 

 

So really, I'd like to show zeros instead of in the Excep columns only if # SLA Met or # SLA Breach have values. 

 

Hope that makes sense.  If anyone can assit I'd be greatly appreciative. 

 

Thanks! 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try the following code:

Excep= IF( [# SLA Met] <> Blank() || [# SLA Breach] <> Blank() ,COUNTAX(task_sla,task_sla[dv_u_breach_code])+ 0)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try the following code:

Excep= IF( [# SLA Met] <> Blank() || [# SLA Breach] <> Blank() ,COUNTAX(task_sla,task_sla[dv_u_breach_code])+ 0)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi @MFelix ,

 

This measure worked perfectly for me, thank you!!

 

I haven't used IF statement very much in DAX, this is great to have in the back pocket. 🙂 

 

aaragon0902_0-1675872634494.png

 

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.