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
PaulMac
Helper IV
Helper IV

Help with SUMX & IF

Hi All

 

I tried searching the forums for previous posts but all existing examples are so specific that none of the solutions were able to help me.

I am sure this is going to be a simple fix but I am having some beginers issues unfortunately. Smiley Frustrated

---

Basically, I work out our SLA for our phone team but when the team gets 0 calls the SLA is at 100%. This confuses some readers of my report and so I want to build a DAX measure that would say: 

 

IF(Phones[Offered]=>0, "N/A"

ELSE

(perform equation to work out SLA%)

SUMX(Phones,Phones[SL]*Phones[Offered])/sum(Phones[Offered])

Any help on this would be greatly appreciated.

 

Many thanks in advance.

 

Kind regards

Paul Smiley Happy

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

I assume the SLA should be calculated for Phones Offered >0, if it is as in your example it's easy to correct

SLA% =
IF (
    SUM ( Phones[Offered] ) > 0,
    DIVIDE (
        SUMX ( Phones, Phones[SL] * Phones[Offered] ),
        SUM ( Phones[Offered] )
    ),
    "N/A"
)

if this doesn't work can you paste here few rows of sample data from Phones table? should be anonymised 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

I assume the SLA should be calculated for Phones Offered >0, if it is as in your example it's easy to correct

SLA% =
IF (
    SUM ( Phones[Offered] ) > 0,
    DIVIDE (
        SUMX ( Phones, Phones[SL] * Phones[Offered] ),
        SUM ( Phones[Offered] )
    ),
    "N/A"
)

if this doesn't work can you paste here few rows of sample data from Phones table? should be anonymised 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Many thanks @Stachu that worked perfectly!! Smiley Very Happy

 

Kind regards

 

Paul

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.