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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply

Power Query - "If query fails, skip step and carry on". How should I code this?

I have a PBI tool which ingests Excel worksheets where the number of them can change. I have a PBI tool currently with 8 seperate versions, each pertaining to the number of worksheets depending on the file ingested. How can I code something, so I can bring it together into one PBI file? Essentially, if I use an 8 worksheet PBI file to ingest a 3 Excel worksheet file, it will fail. Is there a way for PBI to ignore errors and continue the import and subsequently the appending of them?

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @dinosainsburys 
In the current context, the answer is no.
But you can import Excel files with dynamic sheets.
Please refer to the linked tutorial:

https://www.youtube.com/watch?v=JZSdAvGAq_E

If this post helps, then please consider Accepting it as the solution to help the other

members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

2 REPLIES 2
Ritaf1983
Super User
Super User

Hi @dinosainsburys 
In the current context, the answer is no.
But you can import Excel files with dynamic sheets.
Please refer to the linked tutorial:

https://www.youtube.com/watch?v=JZSdAvGAq_E

If this post helps, then please consider Accepting it as the solution to help the other

members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
kleigh
Resolver IV
Resolver IV

You could use a try... otherwise block. Error handling - Power Query | Microsoft Learn

 

It may be possible to re-structure the import so it iterates over the present sheets, rather than trying to access a fixed amount.  

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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 Solution Authors