Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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:
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
8 | |
6 | |
6 | |
6 | |
5 |
User | Count |
---|---|
9 | |
9 | |
8 | |
6 | |
6 |