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
astrbac
Frequent Visitor

How to handle ERROR (NaN, in division /0) values in Get and Transform data model?

Hello,

 

I am importing some data from a .csv (Facebook advertising data). While creating the model in the "Get and Transform" dialog window, I add a column which divides two other columns. Since one of them is sometimes empty (null) or 0,00, in the added column I get a NaN error values. 

 

Finally, this gets me in trouble in the Power pivot section because I cannot calculate, except do a COUNT. Which formula can I enter in the Add column pop up window to handle the error? Something like IFERROR() in Google Sheets or a regular Excel  IF(ISERROR()) formula.

 

Also, which value to use when an error occurs? Empty string "" might produce problems down the road (in pivot calculations), yero (0,00) is not really correct because some cells are null so we don't know what should go here...

 

Many thanks!

A.

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi astrbac,

 

Are you using DAX to achieve the calculate column? If you are, you can use ISERROR() function or IFERROR() function to avoid the NaN or 0 result. If you are using power query to divide two column, you can consider to use error-handling in power query like try ... otherwise ..., please refer to: https://blog.gbrueckl.at/2013/12/error-handling-in-power-query/.

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi astrbac,

 

Are you using DAX to achieve the calculate column? If you are, you can use ISERROR() function or IFERROR() function to avoid the NaN or 0 result. If you are using power query to divide two column, you can consider to use error-handling in power query like try ... otherwise ..., please refer to: https://blog.gbrueckl.at/2013/12/error-handling-in-power-query/.

 

Regards,

Jimmy Tao

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.