Query timeout errors in Power BI indicate that the data source took longer than the allowed limit to respond to a Power Query request. The error appears as QueryTimeout, Query timeout expired, or a source-specific timeout error code.
Understanding the default timeout limits
Power BI has a default query timeout that varies by connection type: - Import mode datasets: queries are limited by Power BI's internal execution limits - DirectQuery: the source query timeout is configurable in the DirectQuery settings (default 10 minutes (600 seconds)) - The on-premises data gateway also imposes its own timeout limits, which can be adjusted in the gateway configuration file
Common causes of query timeouts
Growing tables without indexes: A query that ran in 2 minutes against 5 million rows takes 25 minutes against 50 million rows if there are no appropriate indexes on the filter columns. This is the most common cause of timeout drift — the query was fast originally but becomes slow as data accumulates.
Missing partition pruning: For large partitioned tables, a query that doesn't filter on the partition key scans the entire table. Adding a date filter aligned to the partition column can reduce query time by orders of magnitude.
Complex Power Query transformations: Some Power Query M code generates inefficient SQL that can't be optimized by query folding. M operations that don't fold (like custom functions or operations on unsupported column types) cause the entire table to be loaded before filtering.
Resource contention at the source: The source database is under load from other processes — reports, ETL jobs, or other concurrent Power BI refreshes — when the timeout occurs. The fix here is scheduling, not query optimization.
Solutions by cause
- For large tables: Add indexes on columns used in WHERE and JOIN clauses in your Power Query steps. Use incremental refresh to load only recent data rather than reloading the full table on each refresh.
- For query folding issues: Check whether your Power Query transformations fold by viewing the native query in Power BI Desktop. Restructure M code to use foldable operations where possible.
- For resource contention: Stagger refresh schedules to avoid concurrent load on the source system. Add DirectQuery timeout limits that match the source database's query plan expectations.
- For adjusting the timeout: In Power BI Desktop, go to File → Options → Current file → DirectQuery and increase the query timeout. For gateway connections, the timeout can be increased in the gateway configuration file.