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

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
Responsive Resident
Responsive Resident

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
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