Microsoft Power BI • Publishing and Collaboration

Scheduled Refresh — Configure scheduled refresh and troubleshoot refresh failures (intro)

Keep your Power BI dashboards current by automating data refresh and diagnosing common failure modes.

Microsoft Power BI emblem with a dashboard, stacked chart, and database.
Inside this lesson 10 sections 5 questions 6 figures

SECTION 1

Historical Context & Motivation

Business intelligence platforms have long grappled with a fundamental tension: analysts need fresh data to make sound decisions, yet manual data imports are tedious, error-prone, and fundamentally unscalable. In traditional BI workflows, an ETL (Extract, Transform, Load) pipeline would run on a scheduled basis via an enterprise scheduler such as cron or SQL Server Agent, and downstream reports would only reflect updated data after a human triggered an import or an IT team configured a fragile chain of batch jobs. Scheduled refresh in Power BI emerged as Microsoft's answer to this problem—abstracting the complexity of data pipeline orchestration into a cloud-managed service that any report author can configure through a web interface.

2015 • Power BI Service Launch

Microsoft launched Power BI as a cloud-hosted analytics service. Early versions supported manual PBIX file uploads with limited refresh capabilities, requiring users to re-upload files for updated data.

2016 • On-Premises Data Gateway

The On-premises Data Gateway was introduced, enabling the Power BI Service to reach databases behind corporate firewalls. This was the key prerequisite for reliable scheduled refresh against enterprise data sources.

2018 • Enhanced Refresh & Incremental Refresh

Microsoft added incremental refresh policies, allowing datasets to refresh only new or changed partitions instead of the entire dataset—dramatically reducing refresh times and resource consumption for large tables.

2021 • Enhanced Refresh REST API

The Enhanced Refresh REST API enabled programmatic control over refresh operations, letting DevOps teams integrate Power BI refresh into CI/CD pipelines and external orchestration tools like Azure Data Factory.

2023 • Fabric Integration & Semantic Models

With the introduction of Microsoft Fabric, Power BI datasets were rebranded as semantic models. Refresh scheduling was unified within the broader Fabric lakehouse and data pipeline ecosystem.

The central question that scheduled refresh addresses is straightforward yet critical: how can a cloud-hosted report automatically pull the latest data from potentially dozens of heterogeneous sources—SQL databases, REST APIs, Excel files on SharePoint, cloud data warehouses—without requiring manual intervention, while providing clear diagnostics when something goes wrong? Understanding how to configure and troubleshoot this mechanism is essential for any Power BI practitioner operating in a production environment.

SECTION 2

Core Principles & Definitions

Before configuring a scheduled refresh, you need a clear mental model of the components involved. Power BI's refresh architecture involves a coordination between the Power BI Service (a cloud platform), your semantic model (formerly called a dataset—the in-memory analytical engine that stores your imported data), the data source credentials that authenticate against your upstream systems, and optionally the on-premises data gateway that acts as a secure relay between the cloud service and data sources that are not publicly reachable.

1

Import vs. DirectQuery

Scheduled refresh applies only to Import mode datasets where data is copied into the Power BI model. DirectQuery models query sources live and do not require refresh scheduling—though they introduce latency at query time.
2

Gateway Requirement

If any data source resides on-premises or within a private network, the on-premises data gateway must be installed and registered. Cloud-only sources (e.g., Azure SQL, SharePoint Online) can refresh without a gateway.
3

Credential Management

Each data source referenced by the model requires stored credentials in the Power BI Service. OAuth2 tokens, service principals, or basic authentication pairs must be configured per-source before refresh will succeed.
4

Refresh Frequency Limits

Pro licenses allow up to 8 refreshes per day; Premium/Fabric capacities support up to 48 refreshes per day. These limits govern how frequently you can schedule automatic updates.
5

Incremental Refresh

For large datasets, incremental refresh policies partition data by date range, refreshing only recent partitions. This reduces refresh duration from hours to minutes for multi-million-row tables.
✦

KEY TAKEAWAY

Think of scheduled refresh like a cron job that runs a database ETL pipeline—except the orchestration, credential vault, retry logic, and failure notifications are all managed by the Power BI Service. Your job is to tell the service when to run, how to authenticate, and where to reach the data—similar to writing a Dockerfile that encapsulates the runtime environment so the orchestrator can handle execution.

SECTION 3

Refresh Architecture — Visual Overview

Power BI Scheduled Refresh ArchitectureDATA SOURCESSQL ServerAzure SQL DBSharePoint FilesREST APIsOracle / SAPGATEWAYOn-PremisesData Gateway(Encrypted Tunnel)TLSPOWER BI SERVICERefresh SchedulerCredential StoreMashup Engine (M)HTTPSSEMANTIC MODELIn-Memory (VertiPaq)Compressed ColumnarloadREPORTS & DASHBOARDSVisuals query thesemantic model via DAXFAILURE ALERTSEmail notificationsto dataset owneron failureSchedule: Daily 6:00 AM, 12:00 PM, 6:00 PM UTC │ Timeout: 2 hrs │ Retries: 0 │ License: Pro = 8/day, Premium = 48/day
This diagram illustrates the end-to-end refresh architecture. Data flows from data sources through an optional gateway into the Power BI Service, where the Mashup Engine executes M queries, compresses the results, and loads them into the semantic model. Reports and dashboards then query the updated model. If any step fails, an alert is dispatched to the dataset owner.

The diagram above captures the four critical handoff points where a refresh can fail: the connection from the gateway to on-premises sources (network or firewall issues), the credential exchange between the Power BI Service and the source (expired tokens or changed passwords), the M query execution within the Mashup Engine (query timeout or malformed transformations), and the final data load into the VertiPaq engine (memory exhaustion or capacity throttling). Each of these failure modes produces a distinct error code that we will explore in subsequent sections.

SECTION 4

How Scheduled Refresh Works Under the Hood

When a scheduled refresh fires, the Power BI Service orchestrates a precise sequence of operations. Understanding this sequence is essential for troubleshooting because the error messages you encounter map directly to specific phases of execution. The process is analogous to a CI/CD pipeline: each stage must succeed before the next begins, and a failure at any stage aborts the pipeline and reports the error.

Refresh Execution Phases

  1. Phase 1 — Schedule Trigger: The Power BI Service checks the configured schedule (stored as UTC time slots) and enqueues a refresh job. The job enters a queue managed by the capacity's resource governor.
  2. Phase 2 — Credential Resolution: For each data source in the model, the service retrieves stored credentials from the encrypted credential store. If OAuth2 tokens have expired and cannot be refreshed, the process fails here.
  3. Phase 3 — Gateway Routing (if applicable): The service routes data source requests through the appropriate gateway cluster. The gateway opens an outbound HTTPS connection to the Power BI Service (no inbound firewall rules required) and relays queries to on-premises sources.
  4. Phase 4 — M Query Execution: The Mashup Engine evaluates all Power Query (M) expressions, executing data extraction and transformation steps. This is often the longest phase and is subject to a two-hour timeout for Pro workspaces and a five-hour timeout for Premium.
  5. Phase 5 — Data Load & Compression: The VertiPaq engine compresses and stores the refreshed data in columnar format. If the resulting model exceeds the capacity's memory limit (1 GB for shared capacity, up to 400 GB for Premium P5), the load fails.
  6. Phase 6 — Notification & Logging: The service logs refresh status (success, failure, or cancelled) in the refresh history. On failure, it sends an email notification to the dataset owner and, optionally, to configured notification contacts.

Timeout and Concurrency Constraints

ConstraintPro / SharedPremium / Fabric
Max scheduled refreshes per day848
Refresh timeout2 hours5 hours
Max model size1 GBUp to 400 GB (varies by SKU)
Concurrent refreshes per capacityManaged by serviceConfigurable (default varies by SKU)
Incremental refresh supportYes (limited partitions)Yes (full partition management)

Key constraints governing scheduled refresh behavior across Power BI license tiers.

ℹ

Gateway Architecture Note

The on-premises data gateway initiates outbound connections to Azure Service Bus over HTTPS (port 443). This design means you do not need to open inbound firewall ports, which is a deliberate security architecture choice similar to how SSH reverse tunnels work. The gateway maintains a persistent relay connection and receives refresh commands from the Power BI Service through this channel.

SECTION 5

Common Refresh Failures & Diagnostics

Troubleshooting refresh failures requires a systematic approach. Every failure produces an error entry in the dataset's refresh history, accessible via the Power BI Service under Dataset Settings → Refresh History. The error messages can be cryptic, but they generally map to one of several well-known categories. The diagram below provides a decision-tree approach to diagnosing the most common failure types.

Scheduled Refresh Failure Decision TreeREFRESH FAILEDIs it a credential error?YESNOFix CredentialsRe-enter password / refresh OAuthtoken in Data Source SettingsIs it a gateway error?YESNOFix GatewayCheck gateway status, restartservice, verify network accessIs it a timeout?YESNOOptimize QueriesEnable incremental refresh,reduce data volume, query foldingOtherCheck M queryerrors, capacityCommon Error CodesDM_GWPipeline_*DMTS_DatasourceHasNoCredentialProcessingTimeoutModelRefreshFailed
This decision tree walks through the primary diagnostic path for refresh failures. Start at the top and follow the branches: credential errors are the most common, followed by gateway issues, then timeout errors. The bottom bar lists associated error code prefixes.

Failure Categories in Detail

Failure CategoryTypical Error PatternRoot CauseResolution
Credential ExpiredDMTS_DatasourceHasNoCredentialErrorOAuth2 token expired, password changed, or credentials never entered after publishNavigate to Dataset Settings → Data Source Credentials and re-authenticate
Gateway OfflineDM_GWPipeline_Gateway_UnreachableGateway service stopped, machine rebooted, or network connectivity lostRestart the gateway Windows service; verify outbound HTTPS to *.servicebus.windows.net
Query TimeoutProcessingTimeoutM queries exceed 2-hour (Pro) or 5-hour (Premium) limitEnable query folding, configure incremental refresh, optimize source queries
Data Source UnreachableDM_GWPipeline_UnknownErrorSource database is offline, firewall blocks connection, DNS resolution failureTest connectivity from gateway machine; check source server status and firewall rules
Memory Limit ExceededModelRefreshFailed_MemoryLimitExceededCompressed model exceeds capacity memory allocationReduce columns/rows, upgrade SKU, or enable incremental refresh to limit active partitions

The five most common refresh failure categories with their associated error codes and resolutions.

SECTION 6

Worked Example — Configuring Scheduled Refresh End-to-End

Consider a scenario where you have published a Power BI report that connects to an on-premises SQL Server database containing sales transaction data. The business requires the report to reflect data no older than four hours during business hours. You need to configure scheduled refresh and handle a credential failure that arises after initial setup.

Configuring Scheduled Refresh for a Sales Dashboard

  1. 1

    Step 1 — Verify Gateway Installation

    Navigate to the Power BI Service → Settings (gear icon) → Manage Gateways. Confirm that your on-premises data gateway appears in the list with status Online. If the gateway is not listed, install the gateway application on a machine within the corporate network that has line-of-sight to the SQL Server instance. After installation, sign in with your Power BI organizational account to register the gateway.
    Gateway status: Online ✓
  2. 2

    Step 2 — Add Data Source to Gateway

    In the gateway management page, click "Add data source." Select SQL Server as the data source type. Enter the server name (e.g., sqlprod01.corp.local), the database name (e.g., SalesDB), and the authentication method (Windows or Basic). Enter the service account credentials that have read access to the database. Click "Add" and verify the connection test succeeds.
    Data source connection test: Passed ✓
  3. 3

    Step 3 — Map Dataset to Gateway

    Navigate to the workspace containing your published dataset. Click the ellipsis (⋯) next to the dataset and select "Settings." Under "Gateway connection," the service will display the data sources detected in your model. Map each source to the corresponding gateway data source you just created. If the source names match, Power BI will auto-map them.
    All data sources mapped to gateway ✓
  4. 4

    Step 4 — Configure the Schedule

    In Dataset Settings, expand "Scheduled refresh." Toggle "Keep your data up to date" to On. Set the refresh frequency to "Daily" and add time slots: 6:00 AM, 10:00 AM, 2:00 PM, and 6:00 PM (in your local time zone—Power BI converts to UTC internally). Since the business requires data no older than 4 hours during an 06:00–18:00 window, these four time slots provide adequate coverage. With a Pro license, you are using 4 of your 8 allowed daily refreshes.
    Schedule configured: 4 daily refreshes (6 AM, 10 AM, 2 PM, 6 PM) ✓
  5. 5

    Step 5 — Diagnose a Subsequent Failure

    Two weeks later, the 6:00 AM refresh fails. Check Refresh History and observe the error: DMTS_DatasourceHasNoCredentialError. This indicates the stored credentials are no longer valid—likely because the service account password was rotated by IT. Navigate to Gateway → Data Source → Credentials, re-enter the updated password, and trigger a manual refresh to confirm recovery. Optionally, consider switching to a service principal or managed identity to avoid password-rotation issues in the future.
    Credentials updated → Manual refresh succeeded ✓

SECTION 7

Refresh Strategies — Strengths & Limitations

Scheduled refresh is one of several data freshness strategies available in Power BI. Choosing the right approach depends on your latency requirements, data volume, source architecture, and licensing tier. The table below compares the three primary strategies so you can evaluate tradeoffs systematically.

StrategyLatencyPerformanceLimitations
Scheduled Refresh (Import)Minutes to hours (depends on schedule frequency)Excellent query performance — data is pre-compressed in VertiPaq columnar storeData staleness between refreshes; model size limits; refresh time limits
DirectQueryNear real-time — queries hit the source liveDepends on source performance; no local cachingSlower report rendering; limited DAX functions; heavy load on source system
Composite Model (Hybrid)Mixed — import for historical, DirectQuery for currentBest of both worlds when configured correctlyIncreased complexity; requires careful partition strategy and relationship design
Streaming DatasetSeconds — push API delivers rows in real-timeImmediate visual updates for operational dashboardsVery limited DAX; no historical storage by default; requires custom push integration

Comparison of Power BI data freshness strategies.

✦

KEY TAKEAWAY

Scheduled refresh occupies the sweet spot for most enterprise BI workloads: it trades a bounded amount of data staleness for exceptional query performance and a simple operational model. Think of it like a build cache in a CI system—you accept that the artifact was compiled at a specific point in time rather than recompiling on every request, because the performance gain is worth the acceptable staleness. When staleness tolerance drops below the minimum refresh interval, that is when you should evaluate DirectQuery or composite models.

SECTION 8

Connection to Advanced Refresh Techniques

The basic scheduled refresh configuration covered in this lesson is sufficient for many production scenarios, but Power BI offers several advanced capabilities that build on the same foundational concepts. As you scale to larger datasets, more complex data pipelines, and stricter SLAs, these advanced techniques become essential.

Basic (This Lesson)Advanced (Next Steps)
Full dataset refresh on a fixed scheduleIncremental refresh with RangeStart/RangeEnd parameters and partition policies
Manual trigger or time-based scheduleEnhanced Refresh REST API for programmatic, event-driven refresh (e.g., triggered by Azure Data Factory upon pipeline completion)
Email notification on failureAzure Monitor & Log Analytics integration for centralized monitoring, alerting, and SLA dashboards
Single gateway with default configurationGateway clusters with load balancing and failover for high availability
Username/password credentialsService principal authentication with Azure AD app registrations for non-interactive, rotation-resilient auth
Pro license with 8 daily refresh slotsXMLA endpoint on Premium capacities for fine-grained partition-level refresh using TMSL scripts

Progression from basic scheduled refresh to advanced refresh management.

The Enhanced Refresh REST API deserves particular attention for computer science students, as it transforms Power BI refresh from a manually configured feature into a programmable component of a larger data architecture. By issuing POST /datasets/{datasetId}/refreshes requests with JSON payloads specifying individual tables or partitions, you can integrate refresh orchestration into event-driven architectures—for example, triggering a refresh only after an upstream Spark job completes, rather than refreshing on a fixed schedule that may run before the source data is ready.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Explain why scheduled refresh is required for Import mode datasets but not for DirectQuery datasets. In your explanation, describe what happens to the data at publish time for each mode and how this affects freshness.
Show answer
In Import mode, a snapshot of the source data is extracted, compressed, and stored within the Power BI semantic model (VertiPaq engine) at publish time. This snapshot becomes stale as the source data changes, so scheduled refresh is needed to periodically re-extract and reload the data. In DirectQuery mode, the model stores only metadata and schema information—no actual data rows are imported. Every DAX query issued by a report visual is translated into a native source query (e.g., SQL) and executed live against the data source at query time, meaning the data is always current. Since DirectQuery never caches data locally, there is nothing to "refresh" in the traditional sense, though tile cache refresh schedules can still be configured for dashboard performance optimization.

Question 2: BASIC CALCULATION

A team has a Power BI Pro license and needs their dashboard to show data no older than 3 hours during a 12-hour business window (7 AM – 7 PM). How many scheduled refresh time slots are needed? List the specific times. Is this feasible within the Pro license limit?
Show answer
To ensure data is never more than 3 hours old during a 12-hour window, a refresh must occur at least every 3 hours starting from the beginning of the window. The required time slots are: 7:00 AM, 10:00 AM, 1:00 PM, 4:00 PM, and 7:00 PM—that is 5 refreshes. A Pro license allows up to 8 scheduled refreshes per day, so 5 refreshes is well within the limit. Note that the 7:00 PM refresh ensures that any data displayed right at closing time is at most 3 hours old (refreshed at 4 PM for a user checking at 6:59 PM would be just under 3 hours). Alternatively, if the requirement is strictly "no older than 3 hours at any point," you could shift to 7 AM, 9:30 AM, 12:00 PM, 2:30 PM, 5:00 PM, and 7:00 PM for 6 slots with tighter coverage.

Question 3: INTERMEDIATE

You have published a dataset that connects to both an Azure SQL Database (cloud) and an on-premises Oracle database. After publishing, the scheduled refresh fails with the error: DM_GWPipeline_Gateway_Unreachable. Describe a systematic troubleshooting process with at least four specific checks.
Show answer
This error indicates the Power BI Service cannot communicate with the on-premises data gateway (the Azure SQL source does not need a gateway). A systematic troubleshooting approach would include: (1) Check the gateway machine to verify the "On-premises data gateway" Windows service is running—if it crashed or the machine rebooted without auto-start configured, the service may be stopped. (2) Verify network connectivity from the gateway machine to the internet—the gateway requires outbound HTTPS (port 443) access to .servicebus.windows.net and .frontend.clouddatahub.net; a proxy or firewall change may have blocked these endpoints. (3) Check the gateway logs located at C:\Users\<gateway_user>\AppData\Local\Microsoft\On-premises data gateway\*.log for specific error messages such as authentication failures or TLS handshake errors. (4) In the Power BI Service, navigate to Manage Gateways and confirm the gateway shows as Online; if it shows Offline, the relay connection has been lost. (5) Verify the Oracle data source is properly configured on the gateway with the correct Oracle client drivers installed—the gateway machine must have the appropriate Oracle Data Provider for .NET.

Question 4: APPLIED

Your organization's data engineering team runs an Azure Data Factory pipeline that loads fresh data into Azure SQL Database every night at 2:00 AM. Your Power BI dataset's scheduled refresh is set for 1:30 AM. Users complain that the morning dashboard still shows yesterday's data. Diagnose the issue and propose an architecture that guarantees the refresh runs only after the pipeline completes, using the Enhanced Refresh REST API.
Show answer
The issue is a race condition: the Power BI refresh triggers at 1:30 AM, which is 30 minutes before the ADF pipeline finishes loading new data at approximately 2:00 AM. Consequently, the refresh imports the previous day's data. A time-based schedule is inherently fragile for this pattern because pipeline completion times can vary. The solution is to replace the fixed schedule with an event-driven refresh. In Azure Data Factory, add a "Web" activity as the final step in the pipeline that sends a POST request to the Power BI REST API endpoint: POST https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/refreshes. Authenticate using a service principal registered in Azure AD with Power BI API permissions. This way, the refresh is triggered only after the pipeline's last activity succeeds. You should remove or disable the fixed 1:30 AM schedule to avoid redundant refreshes, and configure the ADF pipeline's failure handling to send alerts if the refresh API call returns an error.

Question 5: CRITICAL THINKING

A large retail company has a 50-million-row fact table that takes 1 hour 45 minutes to fully refresh on a Pro license (2-hour timeout). The data grows by approximately 500,000 rows per day. Analyze the long-term viability of this setup and propose a comprehensive strategy that addresses both the impending timeout risk and the growing data volume. Consider licensing, incremental refresh, query folding, and architectural alternatives.
Show answer
This setup is on a collision course with the 2-hour Pro timeout. At 500K rows/day growth, the refresh duration will likely exceed the limit within weeks. A comprehensive strategy involves multiple layers: First, implement incremental refresh by defining RangeStart and RangeEnd parameters in Power Query that partition the table by date. Configure the policy to refresh only the last 7 days of data while retaining 3 years of history. This reduces the refresh scope from 50M+ rows to roughly 3.5M rows per refresh cycle. Second, ensure query folding is occurring—verify that the M query's filter predicates on the date column are being folded into native SQL WHERE clauses, so the source database sends only the relevant partition's data rather than the full table. You can check query folding in Power Query Editor by right-clicking a step and selecting "View Native Query." Third, evaluate upgrading to Premium Per User (PPU) or Premium capacity, which extends the timeout to 5 hours and increases the allowed refresh frequency to 48/day. Fourth, as a longer-term architectural play, consider migrating to a Lakehouse/Fabric architecture where the data resides in OneLake and the semantic model uses DirectLake mode—this eliminates the traditional import refresh entirely by reading Parquet files directly from the lake, combining import-like performance with near-real-time freshness.

SUMMARY

Scheduled Refresh — Key Concepts Review

Summary

Scheduled refresh is Power BI's mechanism for automatically keeping Import mode semantic models up to date by periodically re-executing M queries against upstream data sources. Configuration requires three elements: a registered on-premises data gateway (for non-cloud sources), properly stored data source credentials, and a defined time-slot schedule within the license limits (8/day for Pro, 48/day for Premium).

The most common refresh failures fall into predictable categories: expired credentials, gateway connectivity issues, query timeouts, and memory limit exceedances. Systematic troubleshooting begins with the refresh history error codes and follows a decision-tree approach to isolate the failure phase. For large or growing datasets, incremental refresh and the Enhanced Refresh REST API provide the scalability and programmability needed for production-grade data architectures.

Varsity Tutors • Microsoft Power BI • Scheduled Refresh — Configure scheduled refresh and troubleshoot refresh failures (intro)