top of page
9d657493-a904-48e4-b46b-e08acb544ddf.png

POSTS

Power BI DirectQuery: Usage, Performance and Best Practices

Power BI DirectQuery performance dashboard concept with data source, model, and report layers
Power BI DirectQuery sketch

Introduction

DirectQuery can be the right Power BI choice, but it should never be the automatic choice. It keeps data in the source and queries it when users interact with a report. This guide explains when DirectQuery makes sense, how it affects performance, and how to design models, DAX, and report pages that stay practical in real business environments.

Why This Matters

Many Power BI projects start with the same pressure: the business wants current data, large datasets, fewer refresh failures, or a report that respects source-system governance. DirectQuery looks attractive because the data stays where it is. The report does not import the full table into the semantic model, and visuals query the source when needed.

That architecture is also the reason why DirectQuery can become slow. Report speed now depends on the source database, gateway, network, model relationships, Power Query folding, DAX logic, visual count, slicers, and user concurrency. A slow source will usually create a slow report.

The most common mistake is choosing DirectQuery only because a table is large. Size alone is not enough. If users can work with refreshed or aggregated data, Import mode, incremental refresh, aggregations, Hybrid tables, Direct Lake, or a live connection may be a better option.

Microsoft’s current guidance is clear: use Import by default because it provides the richest modeling and transformation experience through the in-memory engine. Move beyond Import only when latency, data size, governance, security, or architecture requires it.

Step-by-Step Solution

Step 1: Decide Whether DirectQuery Is Actually Needed

Start with a decision check before you connect to the data source. Ask: Do users truly need low-latency data? Is full import impractical because of volume, regulation, or governance? Can the source answer analytical queries fast enough for interactive reporting?

If the answer to the third question is no, DirectQuery will not solve the problem. It may only move the performance issue from Power BI refresh time to every report interaction.

Good DirectQuery use cases include near real-time operational reporting, data that cannot be fully copied, source-enforced security, and architecture where data must remain in a governed warehouse or lakehouse. Weak use cases include avoiding refresh setup, avoiding data modeling, or connecting directly to raw transactional tables because it feels faster to build.

Step 2: Prepare the Source for Analytical Queries

In DirectQuery, the source system does the heavy work. That means the source must be designed for reporting, not only for transactions. Use clean views, consistent keys, indexed filter columns, and pre-aggregated structures where business users analyze summarized data most of the time.

For SQL-based sources, avoid exposing every operational column to Power BI. Create a reporting layer with only the required fields. Materialize expensive calculations in the source when they are stable business logic. Use integer keys for joins where possible, and review source query plans for slow filters or joins.

  • Use reporting views instead of raw transactional tables.

  • Index common slicer, filter, relationship, and date columns.

  • Create aggregated tables for high-volume facts when users rarely need row-level detail.

  • Keep column names business-friendly before they reach the report layer.

Common mistake: expecting Power BI to hide a weak source design. With DirectQuery, every visual can reveal that weakness immediately.

Step 3: Keep Power Query Transformations Foldable

Query folding means Power Query can translate your transformation steps into a native source query. In DirectQuery, folding is essential because transformations are not simply performed once during refresh. They shape the queries sent to the source while users interact with the report.

Use Power Query for light, foldable work: selecting columns, filtering rows, renaming fields, setting data types, and connecting to well-designed views. Put complex preparation into the source layer when possible.

In Power BI Desktop, right-click an applied step and check View Native Query where available. If the option becomes unavailable earlier than expected, review the previous transformation. Custom functions, complex merges, index columns, and procedural logic often break folding.

Step 4: Build a DirectQuery-Friendly Model

Use a clean star schema. Keep fact tables for measurable events and dimension tables for filtering and grouping. Avoid unnecessary bidirectional relationships, many-to-many patterns, and calculated relationship keys unless they are genuinely required and tested.

A practical composite model can use DirectQuery for a large fact table and Import or Dual storage mode for smaller shared dimensions. Dual tables can behave as either Import or DirectQuery depending on query context, which may reduce repeated remote scans for common dimension filters.

Keep DAX simple at first. Start with base measures and test performance before adding complex filter logic. DirectQuery measures are not only formulas; they influence the native queries generated for the source.

Example DAX: Start With a Simple Base Measure

What it does: calculates total revenue from the Sales fact table. Where to use it: as a base measure in a DirectQuery semantic model. Why it matters: simple aggregations are easier to translate and easier for the source to optimize. Common mistakes: wrapping every base measure in complex CALCULATE logic before checking baseline performance.

Total Revenue =
SUM ( Sales[RevenueAmount] )

Step 5: Design Report Pages for Fewer Queries

A DirectQuery page with many visuals can generate many source queries. Slicers, cards, matrices, tooltips, totals, conditional formatting, cross-highlighting, and multi-select filters all add work. Even if one visual is acceptable, a full report page can still feel slow.

Use the query reduction settings in Power BI Desktop. Add Apply buttons to slicers and filters so users can make several selections before Power BI sends queries. Disable visual interactions that do not add analytical value. Split dense overview pages into focused pages.

Common mistake: placing every KPI on one executive page. For DirectQuery, a cleaner report page is not only better design. It can be a performance requirement.

Step 6: Diagnose Before You Optimize

Use Performance Analyzer in Power BI Desktop before changing measures or relationships. It helps identify whether delay comes from DAX query time, DirectQuery execution, visual rendering, or other processing. That distinction matters because each cause has a different fix.

  1. Open the report in Power BI Desktop.

  2. Go to the Optimize ribbon and open Performance Analyzer.

  3. Start recording and refresh the slow page.

  4. Inspect the slowest visual and copy the generated query if deeper analysis is needed.

If Direct query time is high, focus on the source, folding, filters, joins, indexes, and gateway path. If visual display time is high, reduce visual complexity. If DAX query time is high, simplify measures, relationships, and filter context.

Practical Example

Scenario: A finance team wants a near real-time sales dashboard. Orders arrive throughout the day, and regional managers want current revenue, order count, and margin by date, region, product group, and sales channel.

Sample data structure: FactSalesDaily contains DateKey, ProductKey, RegionKey, ChannelKey, RevenueAmount, MarginAmount, and OrderCount. DimDate contains calendar attributes. DimProduct contains product group and category. DimRegion contains country, region, and manager. DimChannel contains online, retail, and partner channel labels.

Table

Storage mode

Reason

FactSalesDaily

DirectQuery

Needs current measures from source

DimDate

Import or Dual

Small shared slicer table

DimProduct / DimRegion

Import or Dual

Common filters reused across pages

The walkthrough is straightforward. First, create source views that already contain clean keys and stable calculations. Second, connect Power BI to the views and keep transformations foldable. Third, build a star schema with clear relationships. Fourth, create simple base measures and test the report page with Performance Analyzer.

Expected outcome: users get current sales visibility without forcing every visual to scan raw operational tables. The model remains easier to maintain because each layer has a clear responsibility: the source prepares durable business data, Power BI models relationships and measures, and the report guides user interaction.

Bonus Tips and Common Mistakes

Pro Tip: Build a small performance test page before designing the final report. Add one slicer, one card, one matrix, and one line chart. If that page is slow, the final dashboard will not become fast by adding more visuals.

Common Mistake: Treating DirectQuery as a shortcut around data modeling. DirectQuery usually requires more modeling discipline, not less. Weak relationships, unnecessary columns, and complicated measures affect every interaction.

Good to Know: Microsoft documents important DirectQuery limits and implications, including the one million row intermediate result limit, Power BI Service query timeouts, reduced transformation flexibility, and extra work caused by some visuals, slicers, totals, and distinct counts.

Common Mistake: Using relative date filters inside Power Query for DirectQuery models. Microsoft recommends avoiding this pattern and implementing relative date logic in the model or report layer instead.

Pro Tip: Review DirectQuery maximum connections carefully. Increasing concurrent connections can help some reports, but it can also increase load on the source system. More parallel queries are not automatically better.


DirectQuery use cases

DirectQuery is most beneficial when:

  • Data changes too frequently for import (even with incremental refresh and the maximum scheduled refresh frequency), and you need low latency visibility.

  • Data volume or governance constraints make full ingestion impractical.

  • Source enforced security (fine grained row rules) must remain authoritative via passthrough.

  • Data sovereignty or regulatory rules restrict persisted full copies.

  • The source is multidimensional or measure centric (like SAP BW), and server defined measures must be resolved per visual.

Final Thoughts

DirectQuery is powerful when the business requirement truly needs low-latency source access, very large data, source-enforced security, or restricted data persistence. It is not the default answer for every large Power BI dataset.

The best DirectQuery projects are designed end to end: optimized source views, foldable Power Query steps, a clean star schema, simple DAX measures, focused report pages, and evidence-based diagnostics. When those pieces work together, DirectQuery becomes a practical architecture choice instead of a performance gamble.

Recommended next step: before choosing DirectQuery, compare Import, DirectQuery, Hybrid tables, Direct Lake, aggregations, and live connection. Then prototype the slowest expected report page and measure it before you commit the project architecture.

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Page Logo

Turn Messy Data into Clear Dashboards and Better Decisions.

Contact

Address:
83022 Rosenheim, Germany

Join Our Newsletter

Get a free Power Query cheat sheet by subscribing!

© Excelized. All rights reserved.

bottom of page