Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a Power BI on premise with around 20 different datasources in import mode and background refresh every 30 mins.
I'm adding a new connection to my model from an SQL server with an addtional table
My Power Query start with:
let
Source = Sql.Database("SERVER", "database", [Query="EXEC view1"])
Is any way of avoid the hole background refresh to stop if for any reason this connection is not available and fails?. Is it possible to add like an "IF ERROR" to the code, to omit refreshing this connection and continue with the others in case of unavailability of the server?
Thanks
Solved! Go to Solution.
Familiarize yourself with the try ... otherwise ... pattern in Power Query
Hi @pratafran ,
You can manually stop data refresh.
When you open Query Editor in power bi desktop, select the table that you do not want to refresh, right click it and disable Include in report refresh (it is active by default), close and apply Query Editor and the table will not refresh when the report is refreshed.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you,
If I exclude the table from report refresh, It will never refresh. What I'm looking for is to add a kind of conditional to that function. IF the database returns error when refreshing, omit the refresh, otherwise, refresh the content of that connection.
The problem arises with the inestability of a particular connection that I want to avoid stopping the refresh of the whole BI since it is only a dictionary that if it doesn't update, it is not a big issue.
Have you considered my suggestion to use try ... otherwise ... ?
I'm sorry, I hadn't understand your suggestion. I will try that option!
Familiarize yourself with the try ... otherwise ... pattern in Power Query
Thank you very much for your suggestion!, that allowed me to refine my research in google and find a solution.
Below a link to a video which explains with an example, exactly what I was looking for.. the solution was with the "Try ... otherwise ..." statement
On minute 6:50 the example for my case:
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.