Sub topic 10
Reading refresh history
This chapter assumes you can publish a dataset (semantic model) from Power BI Desktop and have already configured a refresh schedule. You should also know what a workspace is and have basic familiarity with the gateway data source mapping from the previous chapters.
Refresh history is the record the Power BI service keeps of each refresh attempt for a dataset. Reading it well tells you whether your data is current, how long refreshes take, and why a failure happened. This chapter covers where to find the history, what each field means, and how to pull the same data through the REST API.
Where to find refresh history
You can open the history in the Power BI service in two ways:
- Go to the workspace, find the dataset, and select Refresh history from its context menu (the three dots) or from the dataset's Refresh menu.
- Open the dataset's settings page and use the Refresh history link in the Refresh section.
The dialog has two tabs. The Scheduled tab lists refreshes started by the schedule. The OneDrive tab appears only for datasets refreshed through OneDrive links. Refreshes you start with Refresh now or through the API appear in the same list, and the history tells them apart by the type shown for each entry.
What each entry tells you
Each row is one refresh attempt. These are the fields you will use most.
| Field | Meaning |
|---|---|
| Type | How the refresh started: scheduled, on demand (manual or API), or via the OneDrive link. |
| Start | When the service began the attempt. |
| End | When the attempt finished or failed. |
| Duration | End minus start. It includes time spent queued and waiting on the gateway. |
| Status | Completed, Failed, or Unknown (see below). |
| Details | For failures, a link to the error message, error code, and request identifiers. |
Status values
- Completed means the service finished loading all tables and the dataset now holds new data.
- Failed means the attempt stopped with an error. The previous data stays in place, so reports keep showing the last successful import.
- Unknown appears for attempts the service cannot classify, such as one that is still running or whose final state was not recorded. Check again after a few minutes before treating it as a problem.
A failed refresh does not clear your data. Users can keep opening reports without errors while the data silently ages. This is why you should watch history, not only report pages.
Reading the error details
Select Show (or the status link) on a failed row to see the error. A typical detail block contains:
- An error message in plain language, such as "The credentials provided for the SQL source are invalid."
- An error code, which you can search in Microsoft documentation or give to support.
- Technical details, including Activity ID, Request ID, Cluster URI, Status code, and Time.
Copy the whole block into your ticket if you need to escalate. The Activity ID and Request ID let Microsoft support find the exact server-side trace.
Spotting patterns
A single row rarely tells the whole story. Scan the list for these patterns.
| Pattern in history | Likely cause |
|---|---|
| Every attempt fails with a credential or connection message | Expired password, changed data source, or the gateway is offline. |
| Failures only at certain hours | Source system maintenance, backups, or heavy load at that time. |
| Duration grows week after week | Source table growth. Consider incremental refresh (covered later). |
| Duration near the timeout limit, then sudden failures | The refresh is reaching the time limit for your capacity type. |
| Long gaps between entries | The schedule was disabled, or the service paused it after repeated failures. |
| Only scheduled entries fail, manual ones succeed | The scheduled run uses stored credentials or a gateway path that your manual test did not exercise. |
The service disables a schedule automatically after several consecutive failures, and it also does so when it detects expired credentials. Microsoft documents this behavior, but the exact number of failures can change, so check the current documentation if it matters to you. When this happens, the history simply stops growing. Open the dataset settings, fix the cause, and turn the schedule back on.
Checking the history with the REST API
The same history is available programmatically. This is useful for dashboards, alerts, and quick checks across many datasets. The call below uses the MicrosoftPowerBIMgmt module and returns the five most recent attempts.
Connect-PowerBIServiceAccount
$groupId = '<workspace-id>'
$datasetId = '<dataset-id>'
Invoke-PowerBIRestMethod -Method Get -Url "groups/$groupId/datasets/$datasetId/refreshes?`$top=5"The backtick before $top stops PowerShell from treating it as a variable. The response is JSON. Each item in value has fields that match the dialog:
refreshType: for exampleScheduled,OnDemand, orViaApi.startTimeandendTime: UTC timestamps in ISO 8601 format.status:Completed,Failed,Unknown, orDisabled. Newer responses useUnknownfor an attempt that is still in progress.serviceExceptionJson: for failures, a JSON string with the error code and message.requestId: the identifier to quote to support.
You can compute durations from the timestamps. The following sketch turns the response into a short table and flags failures:
$json = Invoke-PowerBIRestMethod -Method Get -Url "groups/$groupId/datasets/$datasetId/refreshes?`$top=10"
$refreshes = ($json | ConvertFrom-Json).value
$refreshes | ForEach-Object {
$end = if ($_.endTime) { [datetime]$_.endTime } else { $null }
[pscustomobject]@{
Type = $_.refreshType
Status = $_.status
Start = [datetime]$_.startTime
Minutes = if ($end) { [math]::Round(($end - [datetime]$_.startTime).TotalMinutes, 1) } else { $null }
Error = $_.serviceExceptionJson
}
} | Format-Table -AutoSizeReading history alongside the gateway
When a dataset uses a gateway, the history only shows the outcome seen by the service. The gateway has its own logs and diagnostics, and a good diagnosis uses both.
- Note the Start time and Activity ID of the failed attempt in the history.
- On the gateway machine, open the gateway app and export logs from the Diagnostics tab.
- Search the logs near the same time for the same Activity ID or for the data source name.
If the history says the gateway is unreachable and the logs show no activity at that time, the problem is the connection between the service and the gateway (service stopped, machine off, or outbound ports blocked). If the logs show a request arriving and failing, the problem is between the gateway and the data source (credentials, network path, or the source database).
The following diagram summarizes the decision.
Common mistakes when reading history
- Trusting a green report page. Reports render from the last good import. Always check the time of the last completed refresh.
- Ignoring duration. A refresh that succeeds in 50 minutes against a 2 hour limit is healthy today and risky in a month if it keeps growing.
- Testing only with Refresh now. A manual run succeeding does not prove the schedule works. Confirm the next scheduled entry appears and completes.
- Mixing time zones. The service, the API, and your schedule's configured time zone can all differ.
- Forgetting the schedule can turn itself off. Add a calendar reminder or an automated check that looks for a recent Completed entry.
Exercise
A dataset's refresh history shows no new entries for three days, and the reports show data from last Tuesday. What are two things to check first, and why does the report page not show an error?
Show answer
First, open the dataset settings and check whether the refresh schedule is still enabled, because the service disables a schedule after repeated failures or expired credentials. Second, check the last Failed entry (and its error details) and the gateway status, because an offline gateway or invalid credentials is the usual cause. The report page shows no error because a failed or missing refresh leaves the previous imported data in place, so reports keep rendering the last successful import.
Exercise
You call the refreshes endpoint and see a refresh with startTime 2026-11-27T07:00:00Z, but the schedule is set for 08:00 and the dialog shows 08:00. Is something wrong?
Show answer
No. The API returns UTC and the dialog shows local time. If your local time zone is UTC+1, 07:00Z and 08:00 local are the same moment.