cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PlastiquesMoore
Regular Visitor

NaN error message

Hello to all,

 

I am pretty much new to Power BI and loving it! I'm still getting used to the Power BI terminology so please bare with me.

 

This is my Dax formula and I'm getting some "NaN" results. I would like to change this to "0". Could someone please help me?

 

PPM Externe Médical % Variance = (CALCULATE(sum('Quality (Actuel)'[External PPM - Medical Actuel]) - (sum('Quality (Planifié)'[External PPM - Medical Planifié])))) / (CALCULATE(sum('Quality (Planifié)'[External PPM - Medical Planifié])))
 
Thanks in advance!

 

1 ACCEPTED SOLUTION

Your formula gave me a DAX error. Figured it out to this. Thanks very much for the help!

 

PPM Externe Médical % Variance = DIVIDE((CALCULATE(SUM('Quality (Actuel)'[External PPM - Medical Actuel])-(SUM('Quality (Planifié)'[External PPM - Medical Planifié]))));(SUM('Quality (Planifié)'[External PPM - Medical Planifié]));0)

View solution in original post

4 REPLIES 4
az38
Super User
Super User

Hi @PlastiquesMoore 

use DIVIDE() function, like 

PPM Externe Médical % Variance = DIVIDE(
CALCULATE(sum('Quality (Actuel)'[External PPM - Medical Actuel]) - (sum('Quality (Planifié)'[External PPM - Medical Planifié]))))
, 
CALCULATE(sum('Quality (Planifié)'[External PPM - Medical Planifié]))
,
0
)

  https://docs.microsoft.com/en-us/dax/divide-function-dax here is some details. you can replace 0 at the end to any value you wish to see instead of NaN


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Your formula gave me a DAX error. Figured it out to this. Thanks very much for the help!

 

PPM Externe Médical % Variance = DIVIDE((CALCULATE(SUM('Quality (Actuel)'[External PPM - Medical Actuel])-(SUM('Quality (Planifié)'[External PPM - Medical Planifié]))));(SUM('Quality (Planifié)'[External PPM - Medical Planifié]));0)

@PlastiquesMoore 

now its ok? or try this

PPM Externe Médical % Variance = 
DIVIDE(
(
CALCULATE(SUM('Quality (Actuel)'[External PPM - Medical Actuel]))
-
SUM('Quality (Planifié)'[External PPM - Medical Planifié])
);
SUM('Quality (Planifié)'[External PPM - Medical Planifié]);
0
)

 

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Write the same dax which you have written in original post by using divide function and add zero as third parameter.
Divide(numerator, denominator,0)
Make sure you have closed parenthesis correctly.
You issue will get resolved.

Thanks
Pravin.

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors