Sub topic 8
Configuring the refresh schedule and failure notifications
This chapter assumes you can publish a dataset from Power BI Desktop, that you know what a workspace is, and that the dataset's gateway data source is already mapped (covered in the previous chapter). Here you set when the dataset refreshes and who is told when it fails.
Where the schedule lives
Scheduled refresh is a property of a dataset (semantic model) in the Power BI service. Open the dataset's Settings page and expand Refresh. You will find three parts:
- A switch that turns scheduled refresh on or off.
- A refresh frequency (daily or weekly), a time zone, and a list of times.
- Failure notification options.
Only datasets in Import mode have a schedule. DirectQuery and live connections query the source at view time, so there is nothing to refresh.
Credentials come first
The schedule switch will not do anything useful until the data source credentials are valid. If the dataset uses a gateway, the credentials are those stored on the gateway data source. If it uses a cloud source, edit them under Data source credentials on the same settings page. An expired or missing credential is the most common reason a first scheduled refresh fails.
Setting the schedule in the service
- Turn on Keep your data up to date.
- Choose Daily or Weekly. For weekly, select the days.
- Pick the Time zone. Times are interpreted in this zone, so a daylight saving change can shift the real refresh moment if you pick a local zone. UTC avoids this.
- Use Add another time to add more refresh times for the day.
- Under notifications, choose who is told on failure.
- Select Apply.
Refresh does not start at the exact minute you choose. The service queues it, so expect a delay of several minutes, longer at busy times such as the top of the hour. Do not build a downstream process that assumes the data is ready at 07:00 sharp.
Failure notifications
Under Send refresh failure notifications to, you can choose:
- Dataset owner, who receives an email when a scheduled refresh fails.
- These contacts, an extra list of people or a mail-enabled group, useful when the owner is not the person who fixes problems.
Power BI also disables a schedule that keeps failing. After several consecutive failures, the service pauses scheduled refresh and tells the owner. You must fix the cause and turn the schedule back on. Notifications are your early warning, so make sure the contact list reaches someone who watches it.
Setting the schedule through the REST API
The same settings can be sent as a request body to the Update Refresh Schedule call (a PATCH to the dataset's refreshSchedule endpoint). This body sets two weekday refreshes at 07:00 and 13:00 UTC and requests an email on failure.
{
"value": {
"enabled": true,
"days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"times": ["07:00", "13:00"],
"localTimeZoneId": "UTC",
"notifyOption": "MailOnFailure"
}
}Setting notifyOption to MailOnFailure emails the owner. The API is covered in a later chapter.
Common mistakes
| Mistake | Effect | Fix |
|---|---|---|
| Schedule enabled but credentials invalid | Every run fails | Re-enter credentials, then test |
| Local time zone used across a daylight saving change | Refresh moves by an hour relative to UTC | Use UTC or review the schedule twice a year |
| Notifications go only to a person on leave | Failures go unseen | Add a monitored group as a contact |
Exercise
A dataset is scheduled for 06:00 every day, and the owner reports that the data has not changed for a week, with no failure emails. Name two things to check in the Refresh settings.
Show answer
First, check that the "Keep your data up to date" switch is still on, because the service pauses a schedule after repeated failures. Second, check the refresh history and the notification recipients, because failure emails may have gone to a mailbox nobody reads. Also confirm the credentials are still valid.