Sub topic 9
Direct Lake mode: loading Delta columns into memory without a copy step
This chapter assumes you know Import and DirectQuery basics, star schemas, and simple DAX. It also assumes you know what a Microsoft Fabric workspace and a lakehouse are. The chapter on OneLake and Delta tables covers the file format in more detail. Here the focus is how Direct Lake uses those files.
The problem Direct Lake addresses
Import mode is fast because VertiPaq holds compressed columns in memory. The cost is a refresh that copies every row from the source into the model. DirectQuery avoids the copy and always reads current data. The cost is that every visual waits on the source database.
Direct Lake aims for Import-like query speed without the copy step. A Direct Lake semantic model points at Delta tables stored in OneLake. Delta tables are Parquet files plus a transaction log. Parquet is a columnar format, so it is organized much like VertiPaq's own column storage. When a query needs a column, the engine reads that column's data from the Parquet files and loads it into memory in VertiPaq format. Later queries on that column are served from memory.
How a Direct Lake query runs
Direct Lake does not run a refresh that rebuilds the whole model. Data moves into memory on demand, in three steps.
- Framing. The model records which version of each Delta table it considers current. This is a metadata operation. It reads the Delta log to learn which Parquet files make up each table, and it copies no row data.
- Column loading. A query arrives, for example total sales by year. The engine finds which columns it needs, such as
Sales[Quantity],Sales[UnitPrice], and'Date'[Year]. It loads only those columns from the framed Parquet files into memory. This is sometimes called transcoding, because the Parquet encoding is converted to VertiPaq's structures. - Query execution. DAX runs in the VertiPaq engine against the in-memory columns, as in Import mode.
The first query that touches a cold column pays the loading cost. Later queries on that column are fast. Columns that go unused for a while can be evicted from memory when the capacity needs room.
Framing and freshness
Framing is the Direct Lake counterpart of refresh, and it is much cheaper. A framing operation updates the model's pointer to the current Delta table versions. Data already in memory that belongs to older versions is dropped, and new data loads on demand.
A pipeline writes new rows to a Delta table. Until the model is reframed, reports still show the earlier version. Reframing happens in one of two ways:
- Automatic updates. The semantic model setting "Keep your Direct Lake data up to date" reframes the model when the underlying Delta tables change. This is usually the right choice when you want fresh data.
- Manual or scheduled refresh. You run a refresh from the service, an API call, or a pipeline step. In Direct Lake this is a framing operation, not a data copy. Use this when you want to control when users see new data, for example after a whole batch of tables has finished loading.
Controlled reframing matters because a pipeline may update several tables at different times. If the model reframes in the middle, a fact table could include new orders while a dimension table lacks the matching new customers. Triggering framing once at the end of the pipeline avoids this.
Direct Lake and the measures you already know
Your DAX does not change. A measure such as this one works as written:
Total Sales = SUMX ( Sales, Sales[Quantity] * Sales[UnitPrice] )With Direct Lake, the engine loads Quantity and UnitPrice and evaluates the expression in VertiPaq. A DAX query from a report visual looks the same in every mode:
EVALUATE
SUMMARIZECOLUMNS (
'Date'[Year],
"Total Sales", [Total Sales]
)
ORDER BY 'Date'[Year]Run it in DAX Studio against an Import model, then against a Direct Lake model. Compare the first run with a second run to see the cold versus warm column cost.
Creating a Direct Lake model
You create a Direct Lake semantic model in Fabric, not by importing in Power BI Desktop alone. The usual steps are:
- Put your tables in a Fabric lakehouse or warehouse as Delta tables.
- Create a new semantic model from the lakehouse and select the tables to include.
- Define relationships, measures, and security roles, in the web modeling experience or in Desktop connected to the model.
- Build reports on the model.
Two connection variants exist, and the choice affects fallback behavior:
| Variant | Connects to | Fallback to DirectQuery |
|---|---|---|
| Direct Lake on OneLake | Delta tables directly in OneLake | Not available. A query that cannot be served fails with an error. |
| Direct Lake on SQL endpoints | The SQL analytics endpoint of a lakehouse or warehouse | Available. The engine can run the query as DirectQuery through the endpoint. |
Check the current Microsoft documentation for which variant fits your scenario, since the feature set is still changing.
Fallback to DirectQuery
With the SQL endpoint variant, the engine can sometimes not serve a query from memory. It then switches that query to DirectQuery against the SQL endpoint. Results stay correct, but speed drops to DirectQuery levels. Common causes include:
- A table is a view in the SQL endpoint, not a Delta table.
- The endpoint enforces security, such as row-level security defined on the source tables.
- The data exceeds capacity limits for the Fabric SKU, such as the maximum rows per table or the memory available.
You can control the behavior. Setting the fallback behavior to "Direct Lake only" makes such queries fail with an error, which is useful when you want to find fallbacks during testing instead of silently getting slow reports. The default allows fallback. The next chapter covers framing, column loading, and fallback in more detail.
Common errors and gotchas
- Slow first visual after a reframe. Dropped column data must be reloaded. Warm the model by running a few key queries after refresh, for instance with a scheduled script or a report load.
- Small files hurt. Many tiny Parquet files make the framing and column load slower. Compact tables with
OPTIMIZEin Fabric Spark, and write data with V-Order where supported, which arranges Parquet files for fast VertiPaq reading. - Calculated columns and tables. Direct Lake does not support DAX calculated columns or calculated tables on data from Delta tables. Compute them upstream in the lakehouse transformation, so they exist as real Delta columns.
- Partial data after a mid-pipeline reframe. Covered above. Trigger framing at the end of the load.
- Assuming "no refresh" means "always live". The model shows the framed version. Without automatic updates or a refresh, it can lag.
- Unsupported sources. The data must be in OneLake as Delta tables. Other databases need to be brought in with shortcuts, mirroring, or pipelines first.
Comparing Direct Lake with Import and DirectQuery
| Aspect | Import | DirectQuery | Direct Lake |
|---|---|---|---|
| Where queries run | VertiPaq | Source database | VertiPaq (or source on fallback) |
| Data copy step | Yes, during refresh | None | None, columns load on demand |
| Freshness | As of last refresh | Current at query time | As of last framing |
| Query speed | Fast | Depends on source | Fast when columns are loaded |
| Calculated columns | Supported | Limited | Not supported on Delta data |
Exercise
A pipeline loads a Sales fact table at 02:00 and a Customer dimension at 02:20. Users report that between those times some sales rows show a blank customer name. The model is Direct Lake with automatic updates on. What is the likely cause, and how would you fix it?
Show answer
Automatic updates reframed the model after the fact table changed but before the dimension changed, so the model saw new sales with no matching customers. Turn off automatic updates for the model and trigger a refresh (framing) as the last step of the pipeline, after both tables are written. Users then see both tables change together.
Exercise
The first visual after each framing takes several seconds, but later visuals are quick. Is this a fallback? What would you check to be sure?
Show answer
Probably not. It is most likely column loading, because framing drops old in-memory data and the first query must read the needed columns from Parquet. To confirm, run the same query twice in Performance Analyzer or DAX Studio and compare the times. A slow first run and a fast second run indicates loading. For a SQL endpoint model, set the fallback behavior to "Direct Lake only" in a test. If queries now fail with errors, they were falling back.