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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors