cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tony1 Frequent Visitor
Frequent Visitor

NaN error in Power BI Matrix

Hi All

 

I have a matrix visual with values that are numbers formated as text using the FORMAT() function.  It works fine on PBI Desktop, but when I  publish to the web, it shows several NaN errors.  Why would this happen and how can I fix it?

 

This is one of the measures in the matrix:

Primary =
SWITCH( TRUE() ,
    ISBLANK( [Primary Calc 2] ) , BLANK(),
    MAX( Denomination[Index] ) = 4, FORMAT( [Primary Calc 2] , "#,##0.00 ;(#,##0.00);-  " ),
    MIN( Denomination[Denominator] ) = 1, FORMAT( [Primary Calc 2] , "#,##0 ;(#,##0);-  " ),
    MIN( Denomination[Denominator] ) = 1000, FORMAT( [Primary Calc 2] , "#,##0 ;(#,##0);-  " ),
    MIN( Denomination[Denominator] ) = 1000000, FORMAT( [Primary Calc 2] , "#,##0.0 ;(#,##0.0);-  " ),
    [Primary Calc 2]
)

 

Thank you for your help!

2 REPLIES 2
Community Support Team
Community Support Team

Re: NaN error in Power BI Matrix

Hi @tony1,

 

I tested the same FORMAT formula, I didn't get NaN errors after publishing to service.

 

In your scenario, if you don't format the numeric values as Text, will issue persist in service? For further analysis, please post sample data and the DAX formula of [Primary Calc 2] and show us how is the Matrix look like. If possible, you could share your .pbix file.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tony1 Frequent Visitor
Frequent Visitor

Re: NaN error in Power BI Matrix

Hi Yuliana

 

Thank you for your response.  I couldn't format the values as anything other than text.  

 

After playing around with the slicers on the report I realised that the issue arises when the number formatted is less than 1,000 and greater than zero.

 

Unfortunately, the pbix file contains sensitive data so I can't share publicly, but I could send it to you.

 

Regards

Tony