Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
tony1
New Member

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
v-yulgu-msft
Employee
Employee

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.

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors