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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors