Business Professionals
Power BI | Power Pivot | Power Query | DAX
Cloud Flows | RPA | AI Builder | Copilot
60+ Formulas | Data Stories | Advanced Reporting & Modeling
VB Programming | Report Automation |
MS-Office Automation
Techno-Business Professionals
Power BI | Power Query | Advanced DAX | SQL - Query &
Programming
Microsoft Fabric | Power BI | Power Query | Advanced DAX |
SQL - Query & Programming
Power BI | Power Apps | Power Automate | Copilot Studio | Power Pages | Dataverse
Microsoft Power Apps | Microsoft Power Automate
Power BI | Adv. DAX | SQL (Query & Programming) |
VBA | Python | Web Scrapping | API Integration
Power BI | Power Apps | Power Automate |
SQL (Query & Programming)
Power BI | Adv. DAX | Power Apps | Power Automate |
SQL (Query & Programming) | VBA | Python | Web Scrapping | API Integration
Power Apps | Power Automate | SQL | VBA | Python |
Web Scraping | RPA | API Integration
Technology Professionals
Power BI | DAX | SQL | ETL with SSIS | SSAS | VBA | Python
Power BI | SQL | Azure Data Lake | Synapse Analytics |
Data Factory | Databricks | Power Apps | Power Automate |
Azure Analysis Services
Microsoft Fabric | Power BI | SQL | Lakehouse |
Data Factory (Pipelines) | Dataflows Gen2 | KQL | Delta Tables | Power Apps | Power Automate
Power BI | Power Apps | Power Automate | SQL | VBA | Python | API Integration
Power BI | Advanced DAX | Databricks | SQL | Lakehouse Architecture
Business Professionals
Power BI | Power Pivot | Power Query | DAX
Cloud Flows | RPA | AI Builder | Copilot
60+ Formulas | Data Stories | Advanced Reporting & Modeling
VB Programming | Report Automation |
MS-Office Automation
Techno-Business Professionals
Power BI | Power Query | Advanced DAX | SQL - Query &
Programming
Microsoft Fabric | Power BI | Power Query | Advanced DAX |
SQL - Query & Programming
Power BI | Power Apps | Power Automate | Copilot Studio | Power Pages | Dataverse
Microsoft Power Apps | Microsoft Power Automate
Power BI | Adv. DAX | SQL (Query & Programming) |
VBA | Web Scrapping | API Integration
Power BI | Power Apps | Power Automate |
SQL (Query & Programming)
Power BI | Adv. DAX | Power Apps | Power Automate |
SQL (Query & Programming) | VBA | Web Scrapping | API Integration
Power Apps | Power Automate | SQL | VBA |
Web Scraping | RPA | API Integration
Technology Professionals
Power BI | DAX | SQL | ETL with SSIS | SSAS | VBA
Power BI | SQL | Azure Data Lake | Synapse Analytics |
Data Factory | Azure Analysis Services
Microsoft Fabric | Power BI | SQL | Lakehouse |
Data Factory (Pipelines) | Dataflows Gen2 | KQL | Delta Tables
Power BI | Power Apps | Power Automate | SQL | VBA | API Integration
Power BI | Advanced DAX | Databricks | SQL | Lakehouse Architecture
Power BI DirectQuery against MS-SQL can be fast enough for real-world reporting, but only if the database and model are designed for it. This guide walks through how to tune indexing, use aggregations properly, and decide when it’s time to abandon DirectQuery and move to Import mode.
If you want to go deeper into building robust models on top of SQL Server, pairing this with a structured path like a Power BI with SQL workflow helps you connect the database side with the reporting layer.
You already know the high-level difference: DirectQuery leaves the data in SQL Server; Import loads it into the VertiPaq engine. What matters for performance is how that changes query patterns.
When a user:
Power BI generates SQL and sends it to the source. That means:
With Import mode, SQL Server mostly feels:
So with DirectQuery, SQL Server is now a live OLAP backend. Your indexing, schema, and resource allocation must reflect that.
Before changing indexes, capture what Power BI is actually doing.
On SQL Server, capture:
SELECT queries from the Power BI service / gatewayExample: a typical DirectQuery request might look like:
SELECT
d.CalendarDate,
SUM(f.SalesAmount) AS SalesAmount,
SUM(f.Quantity) AS Quantity
FROM dbo.FactSales f
JOIN dbo.DimDate d
ON f.DateKey = d.DateKey
WHERE
d.CalendarDate BETWEEN @P1 AND @P2
AND f.ChannelKey = @P3
GROUP BY
d.CalendarDate;
Patterns to look for:
DateKey, CustomerKey, ChannelKey)GROUP BY columnsThese patterns should drive your indexing strategy.
You’re not indexing for OLTP anymore; you’re indexing for reporting queries that aggregate and filter.
Clustered index on the fact table
Nonclustered indexes on common filter + join columns
CustomerKey, ProductKey, DateKey)ChannelKey if heavily filtered)Covering indexes for high-traffic queries
SELECT and GROUP BY to avoid lookups.Assume a typical star schema:
CREATE TABLE dbo.FactSales
(
SalesId BIGINT IDENTITY(1,1) NOT NULL,
DateKey INT NOT NULL,
CustomerKey INT NOT NULL,
ProductKey INT NOT NULL,
ChannelKey INT NOT NULL,
SalesAmount DECIMAL(18,2) NOT NULL,
Quantity INT NOT NULL,
CONSTRAINT PK_FactSales PRIMARY KEY CLUSTERED (SalesId)
);
Add nonclustered indexes tuned for DirectQuery:
-- Filter by date, aggregate by date
CREATE NONCLUSTERED INDEX IX_FactSales_DateKey
ON dbo.FactSales (DateKey)
INCLUDE (SalesAmount, Quantity, ChannelKey);
-- Filter by customer, aggregate by date and customer
CREATE NONCLUSTERED INDEX IX_FactSales_CustomerKey
ON dbo.FactSales (CustomerKey, DateKey)
INCLUDE (SalesAmount, Quantity);
-- Filter by channel
CREATE NONCLUSTERED INDEX IX_FactSales_ChannelKey
ON dbo.FactSales (ChannelKey, DateKey)
INCLUDE (SalesAmount, Quantity);
For large fact tables, clustered columnstore indexes are often the best choice for analytic queries:
Example:
CREATE CLUSTERED COLUMNSTORE INDEX CCI_FactSales
ON dbo.FactSales;
Trade-offs:
In many DirectQuery scenarios, a clustered columnstore on the fact table plus rowstore nonclustered indexes on key filter columns gives a good balance.
Even with perfect indexing, a poor Power BI model can generate ugly SQL.
Each extra hop in the relationship graph becomes another join in SQL.
Complex DAX often translates into complex SQL. For heavy logic, consider moving it into SQL views:
Example: a view that pre-joins and simplifies sales data:
CREATE VIEW dbo.vw_FactSalesReporting
AS
SELECT
f.SalesId,
d.CalendarDate,
c.CustomerKey,
c.CustomerSegment,
p.ProductKey,
p.ProductCategory,
f.ChannelKey,
f.SalesAmount,
f.Quantity
FROM dbo.FactSales f
JOIN dbo.DimDate d ON f.DateKey = d.DateKey
JOIN dbo.DimCustomer c ON f.CustomerKey = c.CustomerKey
JOIN dbo.DimProduct p ON f.ProductKey = p.ProductKey;
Then connect Power BI to vw_FactSalesReporting instead of the raw fact table.
Some patterns are more expensive in DirectQuery:
CALCULATE with complex filter expressionsFILTER(ALL(...)) over large tablesDISTINCTCOUNTWhere possible:
Aggregations let you keep the detail table in DirectQuery while creating Import-mode summary tables for speed.
Use aggregations when:
Example: SQL aggregation table for daily category sales:
CREATE TABLE dbo.Agg_Sales_DailyCategory
AS
SELECT
f.DateKey,
p.ProductCategory,
SUM(f.SalesAmount) AS SalesAmount,
SUM(f.Quantity) AS Quantity
FROM dbo.FactSales f
JOIN dbo.DimProduct p
ON f.ProductKey = p.ProductKey
GROUP BY
f.DateKey,
p.ProductCategory;
In Power BI:
Agg_Sales_DailyCategory in Import modeFactSales as DirectQueryDateKey → DateKeyProductCategory → ProductCategorySUM(SalesAmount) → SalesAmountSUM(Quantity) → QuantityNow, visuals that only need daily category data hit the Import table; only detailed drill-throughs hit DirectQuery.
There’s a point where you’re fighting the engine. Recognize it early.
Switch (or partially switch) to Import when:
Hybrid patterns work well:
Example architecture:
FactSales_History (Import, up to last month)FactSales_Recent (DirectQuery, current month)When a DirectQuery report is slow, work through this list:
Capture real queries
Index for those queries
Simplify the model
Push heavy logic to SQL
Add aggregations
Re-evaluate the mode choice
Pick your slowest DirectQuery report, capture its top three SQL queries, and create one targeted nonclustered index plus one Import-mode aggregation table that matches those query patterns. In many cases, that single round of tuning is enough to turn a painful report into something users are happy to work with—and it will tell you quickly whether DirectQuery still has headroom, or whether it’s time to plan a move to Import.
MS-SQL
New
Next Batches Now Live
Power BI
SQL
Power Apps
Power Automate
Microsoft Fabrics
Azure Data Engineering