Sub topic 2
Storage modes: Import, DirectQuery, Direct Lake, and Dual
This chapter assumes you can build a basic model in Power BI Desktop, that you know star schemas (fact and dimension tables), and that you can write simple DAX measures. Knowing what a Fabric workspace is helps for the Direct Lake section. Later chapters cover each mode in detail. Here you learn what the four modes are and how they differ, so the rest of the tutorial has a map.
What a storage mode is
A storage mode is a property of a single table in a semantic model. It tells the engine where the table's rows live when a report asks a question. There are two broad answers: in the model's own memory, or in the source system.
Because the property belongs to the table and not to the whole model, one model can mix modes. A model whose tables all use Import is an Import model. A model whose tables all use DirectQuery is a DirectQuery model. A model that mixes them is a composite model.
The storage mode does not change how you write relationships or measures. It changes where the data is read from, how fresh it is, how fast queries run, and which features are available.
The four modes at a glance
| Mode | Where the data lives at query time | How it gets current | Typical strength | Typical cost |
|---|---|---|---|---|
| Import | Compressed copy in the model's memory | Scheduled or incremental refresh | Fastest queries, full DAX and Power Query | Refresh time, memory, stale data between refreshes |
| DirectQuery | In the source database | Every query reads the source | Fresh data, no copy, very large sources | Slower queries, source load, modeling limits |
| Direct Lake | Delta tables in OneLake, loaded into memory on demand | Framing (a metadata update) | Import-like speed without a copy step | Needs Fabric, depends on Delta table design |
| Dual | In memory and in the source | Like Import | Lets a table serve either kind of query | Only useful in composite models |
Import mode
In Import mode, Power BI reads the source during a refresh. It then compresses the rows into the VertiPaq in-memory columnar engine and stores them in the model. When a visual runs a query, the engine answers it from that memory and does not contact the source.
This gives the fastest and most flexible behavior. Every DAX function works, and Power Query can transform the data before loading. The price is that the data is only as fresh as the last refresh. The model also takes up memory, and large tables make refresh slow. Incremental refresh reduces that cost by refreshing only recent partitions. It is covered in a later chapter.
DirectQuery mode
In DirectQuery mode, Power BI stores only metadata: table names, columns, relationships, and measures. No rows are copied. When a visual runs, the engine translates the DAX query into a SQL query, sends it to the source, and returns the result.
Data is as fresh as the source at the moment of the query, and the model can sit on top of data too large to import. Every interaction becomes a source query, so report speed depends on the source's speed and on how many visuals the page has. Some DAX functions and Power Query transformations are limited or unavailable, because they cannot be translated to the source's SQL. Row counts returned by a single query are also capped.
Direct Lake mode
Direct Lake is available in Microsoft Fabric. The tables are Delta tables stored in OneLake, usually in a lakehouse or warehouse. Delta is an open table format built on Parquet files plus a transaction log.
A Direct Lake model does not copy the data in a refresh step the way Import does. When a query needs a column, the engine loads that column from the Parquet files straight into VertiPaq memory. After that, queries on that column run at in-memory speed. When the Delta table changes, a refresh operation called framing updates the model's pointers to the current Parquet files. It is a metadata operation and does not reload all the data.
Direct Lake comes in two variants, and they differ in an important way:
- Direct Lake on SQL endpoints can fall back to DirectQuery against the SQL endpoint. Fallback happens when a query uses a feature Direct Lake does not support, such as a SQL view, or when the data exceeds the capacity's limits.
- Direct Lake on OneLake reads Delta tables directly and does not fall back to DirectQuery.
Which variant you have decides whether you need to watch for silent fallback. The framing and fallback chapter covers this.
Combining Direct Lake tables with Import or DirectQuery tables in one model has been restricted, and the rules have been changing. Check the current Microsoft documentation before you plan a mixed design.
Dual mode
Dual is not a data source. It is a storage mode that lets a table behave either as Import or as DirectQuery, whichever suits the query.
Dual matters in composite models. Suppose a Date dimension is Import and FactSales is DirectQuery on the same source. A query that filters FactSales by Date[Year] needs both tables. If Date is Import, the relationship between an in-memory table and a source-side table is limited, which makes the join less efficient. If Date is Dual, the engine can run the whole query at the source, joining the two as a single SQL statement. Queries that touch only Date, such as a slicer, are answered from memory.
Dual tables are loaded into memory like Import tables, so they need refresh as well.
Where you set the storage mode
In Power BI Desktop, open Model view, select a table, and open the Properties pane. Under Advanced, you will find Storage mode. The options offered depend on the connector. A table from a file offers only Import. A table from a SQL source offers Import, DirectQuery, and Dual. Direct Lake tables are created in Fabric from a lakehouse or warehouse and edited in the web modeling experience or in Desktop's live edit mode.
Switching has one-way rules:
- DirectQuery to Import is allowed.
- Import to DirectQuery is not allowed, because the Power Query steps already applied may not be translatable to SQL.
- Dual can be set on a table that is currently Import or DirectQuery, but the table must be able to run both ways.
One measure, three engines
A measure's text is the same in every mode. What changes is who executes it.
Total Sales = SUMX ( Sales, Sales[Quantity] * Sales[UnitPrice] )For Import and Direct Lake tables, VertiPaq evaluates this in memory. For DirectQuery tables, the engine translates it into a SQL query with a SUM of the product, and the source database does the work.
A report visual produces a DAX query like this one. You can run it in DAX Studio, or inspect it in Performance Analyzer, to compare behavior across modes.
EVALUATE
SUMMARIZECOLUMNS (
'Date'[Year],
"Total Sales", [Total Sales]
)
ORDER BY 'Date'[Year]The following diagram shows where a query goes in each mode.
Common errors
- Expecting fresh data from an Import table. Import data is current only as of the last refresh. If users report stale numbers, check the refresh history first.
- Choosing DirectQuery to avoid refresh, then finding reports slow. The refresh cost moves to every query. The source must be able to handle the report's query load.
- Leaving dimension tables as Import beside a DirectQuery fact table. The limited relationship can force slower query plans. Dual is usually the better setting for these dimensions.
- Assuming Direct Lake always reads in memory. On SQL endpoint models, a query can fall back to DirectQuery without any visible error, and the report just gets slower.
- Trying to switch Import to DirectQuery. Desktop does not allow it. You have to rebuild the table from a new DirectQuery connection.
- Using a DAX function or Power Query step that the DirectQuery source cannot translate. The model shows an error or runs slowly. Test such measures against the actual storage mode.
Exercise
A model has a DirectQuery FactOrders table and an Import Customer dimension that both come from the same SQL database. Slicing orders by customer region is slow. Which storage mode would you try for Customer, and why?
Show answer
Dual. A Dual table can be joined to the DirectQuery fact table inside a single SQL query at the source, which avoids the limited relationship between an Import table and a DirectQuery table. Queries that use only Customer, such as a slicer, are still answered from memory.
Exercise
Name two differences between how Import mode and Direct Lake mode keep data current.
Show answer
Import copies the data into the model during a scheduled or incremental refresh, so the model holds a separate copy that is as old as the last refresh. Direct Lake reads Delta files in OneLake and keeps current through framing, a metadata update that points the model at the latest files, with columns loaded into memory on demand and no full copy step.