Forum Discussion
PlastiquesMoore
6 years agoRegular 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" resu...
- 6 years ago
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)
az38
6 years agoCommunity Champion
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
- PlastiquesMoore6 years agoRegular Visitor
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)- Anonymous6 years agoNot applicableWrite 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. - az386 years agoCommunity Champion
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 )