Scheduled Refresh & Gateways
A published report shows the data that was imported the last time it was refreshed. If nobody refreshes it, Monday's report still shows last Friday's sales, and people quietly stop trusting it. Scheduled refresh in the Power BI service fixes this by re-running your Power Query steps on a timetable. But the service lives in Microsoft's cloud, so it can only refresh data it can reach. For data inside your office network, it needs a bridge called an on-premises data gateway.
In this lesson you will set up scheduled refresh, decide whether you need a gateway, move files to the cloud to avoid one, and show readers exactly when the data was refreshed.
How refresh works
When an imported semantic model refreshes, the service connects to each data source with stored credentials, runs every query, loads the new data into the model, and recalculates calculated columns and tables. Measures need no refresh; they are calculated when visuals load.
You can refresh in three ways:
- Refresh now on the semantic model in the service, for a one-off update.
- Scheduled refresh, on a timetable.
- Republishing from Desktop after refreshing there (fine while developing, not as a daily routine).
DirectQuery models do not import data, so they do not need scheduled data refresh; each visual queries the source when it loads.
Setting up a schedule
In the workspace, open the semantic model, select Refresh > Schedule refresh (or open its Settings), and work through the sections:
- Gateway and cloud connections: choose a gateway if one is needed (see below).
- Data source credentials: sign in to each source once; the service stores the credentials.
- Refresh: switch Configure a refresh schedule on, choose Daily or Weekly, set the time zone to
(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi, and add time slots. - Tick Send refresh failure notifications to the owner (and add a colleague).
Limits documented by Microsoft (November 2026):
| Item | Limit or behaviour |
|---|---|
| Scheduled refreshes per day | Up to 8 in Pro workspaces; up to 48 with PPU, Premium or Fabric capacity |
| Start time | Aimed within 15 minutes of the slot; can be up to an hour late on a busy service |
| Inactivity | Paused after two months with no one viewing any report on the model |
| Failures | The schedule is switched off after four consecutive failures or an error such as expired credentials |
| Monthly schedule | Not available (only daily or weekly) |
When something goes wrong, open Refresh > Refresh history to see each attempt's status, duration and error message.
Do you need a gateway?
The question is simple: can Microsoft's cloud reach the data over the internet?
| Data source | Gateway needed? |
|---|---|
| Excel or CSV on your laptop's C: drive or an office file server | Yes |
| SQL Server or MySQL on a server inside the office network | Yes |
| Files in SharePoint Online or OneDrive for work or school | No |
| Azure SQL Database or other cloud databases reachable online | No |
| Online services such as Dynamics 365 or Salesforce | No |
An on-premises data gateway is a Windows program installed on a computer inside your network. It makes outbound connections to the cloud, so no inbound firewall ports need opening. Microsoft offers three options:
- Standard mode: managed by gateway admins, shared by many users and data sources; supports DirectQuery and live connections, and can run as a cluster for high availability. This is what companies use.
- Personal mode: for one user refreshing their own import models only; cannot be shared. Some connectors, such as MySQL, are not supported in personal mode.
- Virtual network (VNet) data gateway: a Microsoft-managed service for data secured inside an Azure virtual network; nothing to install.
A gateway machine must be switched on and connected at refresh time. A gateway on someone's laptop that goes home at 6 pm is a common reason for 6 am refresh failures. Install it on an always-on server, keep it updated, and make sure the drivers your sources need (for example MySQL Connector/NET) are installed on that machine too.
Avoid a gateway: put files in the cloud
For a small business, the simplest fix is to keep source files in SharePoint Online (or OneDrive for work or school) instead of C:\KesarMart. Then the service reaches them directly. Replace the Folder connector from Get Data: Excel, CSV & Folders with the SharePoint folder connector:
let
Source = SharePoint.Files("https://kesarmart.sharepoint.com/sites/Sales", [ApiVersion = 15]),
MonthlyCsv = Table.SelectRows(
Source,
each Text.Contains([Folder Path], "/Shared Documents/Monthly/")
and Text.Lower([Extension]) = ".csv"
)
in
MonthlyCsvSharePoint.Files lists every file in the site's document libraries, so filter on Folder Path and Extension before combining, exactly as you did for a local folder. Sign in with your organisational account when asked; the service uses the same type of sign-in for refresh.
Show when the data was refreshed
Readers should never have to guess. Add a tiny query called Last Refresh that records the time each refresh runs. The service runs refreshes in UTC, so convert to Indian Standard Time explicitly:
let
RefreshedIST = DateTimeZone.RemoveZone(
DateTimeZone.SwitchZone(DateTimeZone.UtcNow(), 5, 30)
),
LastRefresh = #table(type table [Refreshed At = datetime], {{RefreshedIST}})
in
LastRefreshDateTimeZone.UtcNow returns the current UTC time, SwitchZone moves it to UTC+05:30, and RemoveZone keeps a plain date and time. Then show it with a measure:
Last Refresh Text =
"Data refreshed: "
& FORMAT ( MAX ( 'Last Refresh'[Refreshed At] ), "dd mmm yyyy, hh:mm AM/PM" )
& " IST"A card then reads something like "Data refreshed: 03 Nov 2026, 06:05 AM IST". Combine it with the "Sales up to" measure from Publishing, Sharing & Dashboards: one says when the refresh ran, the other says how recent the data in the source was.
Common mistakes
- Gateway on a laptop. Refresh fails whenever the laptop sleeps. Use an always-on machine, or move the data to the cloud.
- Expired passwords. Changing a database password breaks refresh until you update the credentials in the semantic model settings.
- Wrong time zone. A schedule left in UTC runs at 11:30 am IST instead of 6 am. Choose the India time zone.
DateTime.LocalNow()for the refresh time. In the service it returns the server's time, not India's. Convert from UTC explicitly.- Ignoring failure emails. Four failures in a row switch the schedule off. Fix the cause and switch it back on.
Key points
- Scheduled refresh re-runs your queries in the service: up to 8 times a day in Pro, up to 48 with PPU or capacity.
- Refresh pauses after two months of no views and switches off after four consecutive failures.
- On-premises data (local files, office servers) needs an on-premises data gateway; standard mode for teams, personal mode for one user.
- Files in SharePoint Online or OneDrive for work or school, and cloud databases, need no gateway.
- Record the refresh time in IST with
DateTimeZone.SwitchZoneand show it on every report.
Exercise
Kesar Mart's sales come from three sources: a SQL Server in the Jaipur head office, a targets workbook on the analyst's laptop, and a product list in SharePoint Online. The owner wants the report refreshed at 7 am and 1 pm IST every day. Say which sources need a gateway, what kind of gateway you would install and where, how you would change the setup to need fewer gateways, and whether a Pro workspace can handle the schedule.
Show solution
| Source | Gateway? | Plan |
|---|---|---|
| SQL Server in head office | Yes | Install the on-premises data gateway in standard mode on an always-on server in the head office, and add the SQL Server data source to it |
| Targets workbook on a laptop | Yes, as it stands | Move the file to SharePoint Online; then no gateway is needed |
| Product list in SharePoint Online | No | Sign in with the organisational account in the data source credentials |
After moving the workbook, only the SQL Server needs the gateway. Two refreshes a day (7:00 and 13:00, time zone UTC+05:30) is well within the Pro limit of 8 per day. Add failure notifications for the analyst and the Last Refresh card so readers can see the time of the latest successful refresh.
Quick Quiz
1. How many scheduled refreshes per day does a Pro workspace allow?
Pro allows up to 8; PPU, Premium and Fabric capacities allow up to 48.
2. Which source needs an on-premises data gateway for scheduled refresh?
The cloud service cannot reach files inside the office network without a gateway.
3. What happens after four consecutive refresh failures?
Microsoft deactivates the schedule after four failures in a row.
4. Why use DateTimeZone.SwitchZone ( DateTimeZone.UtcNow (), 5, 30 ) for a refresh timestamp?
Converting from UTC gives the correct Indian time wherever the refresh runs.
Learn Power BI with a mentor
Free lessons get you started. Our Data Analytics & Power BI training adds real projects and code reviews from working developers.
- Project-based learning
- Mentor code reviews
- Free counselling call
