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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
stephdurand
New Member

How to handle a column error and avoid loosing all previously calculated data

Hello everyone,

 

I have built an Excel file that gets data from REST API using the web.contents function. The result of the API (Json) is developed in order to have some of the content of the data in dedicated columns

It sometimes happen that the API fails (400 or 500 return code) and in this situation, the develop function fails as the content of the column is not a record (If the return code is not 200, the column is set with the http return code). I managed to filter the rows based on the non expected values (i.e. 400 or 500) but this is not the most efficient solution as if any other http code is returned, I'll loose again the data up to the point of failure.

My Excel file is currently running hence not possible to show any content but I will as soon as it finished (hopefully with sucess this time).
Maybe someone has already a hint on how to manage this situation of non expected column type...

Thanks in advance!

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @stephdurand 

 

Hard to give advice without seeing the code and data but you might be able to use try ... otherwise to check what the API returns and take appropriate action.

 

This might explain how to use try ... otherwise

 

IFERROR in Power Query Using TRY OTHERWISE • My Online Training Hub

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors