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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register 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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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