Sub topic 10
Framing, Column Loading, and Fallback to DirectQuery
This chapter covers how a Direct Lake semantic model keeps its data current and how it answers queries. It explains three mechanisms: framing, column loading, and fallback to DirectQuery. It assumes you know what a semantic model is, how a Delta table in OneLake is stored, and the basics of Import and DirectQuery from earlier chapters.
The idea in one paragraph
A Direct Lake model has no copy step. It does not load data on a refresh schedule the way Import does, and it does not send every query to a source the way DirectQuery does. Instead, it records which Delta files make up each table (framing). It loads only the columns a query needs into VertiPaq memory (column loading). If it cannot serve a query from those files, it may send the query to a SQL endpoint (fallback), depending on the model's behavior setting.
Framing: pinning a version of the Delta tables
A Delta table is a set of Parquet files plus a transaction log. Each commit to the log adds or removes files, so the table has a sequence of versions. Framing is the operation that points the semantic model at one specific version of each table. The model learns which Parquet files belong to the table and the table's metadata. It does not read the column data at this point.
Because framing reads only metadata, it is fast and cheap. It is often called a "refresh" in Direct Lake, but it differs from an Import refresh in two ways:
- It does not copy or recompress data.
- It does not take a time proportional to the table size.
Framing gives you a consistent view. Until the next framing operation, every query sees the same table version, even if a pipeline is writing new files. That prevents a report page from mixing rows from before and after a load.
When framing happens
- Automatic updates: the model option that keeps Direct Lake data up to date is on by default. When the Delta tables change, the model reframes itself.
- Manual or scheduled refresh: you trigger a refresh from the service, the API, or a pipeline step. In Direct Lake it performs framing.
- After a load you control: a common pattern is to run a refresh as the last step of the pipeline that writes the Delta tables. Readers then never see a half-finished load.
If you turn off automatic updates, the model keeps showing the old version until you run a refresh. This is useful when you want to publish the data only after validation checks pass.
What framing does to memory
When the model is reframed, columns already in memory are no longer valid for the changed tables. The engine evicts the stale data and loads columns again on demand. The first queries after a reframe can therefore be slower than later ones. This is called a cold start for those columns.
Column loading: transcoding on demand
The VertiPaq engine works on columns held in memory in its own compressed format. Parquet files use a different layout. Direct Lake bridges the two with transcoding. When a query touches a column, the engine reads that column's data from the Parquet files and converts it into VertiPaq's structures: dictionary, encoded values, and so on. It leaves the other columns alone.
Key points:
- Loading is per column, not per table. A query on
Sales[Quantity]does not loadSales[Comment]. - Loaded columns stay in memory until the model is reframed or the capacity needs the memory for something else.
- The cost of transcoding is paid by the first query that needs the column. After that, queries run at VertiPaq speed, like Import.
- Relationship columns, and columns used in joins or hierarchies, may also load structures needed to evaluate them.
Warming the model
If the cold-start delay is a problem, you can warm the model by running representative queries after a reframe. Report authors often schedule a few DAX queries, like the one below, right after the refresh step. The query touches the columns that the main report pages use, so they are loaded before users arrive.
EVALUATE
SUMMARIZECOLUMNS (
'Date'[Year],
"Total Sales", [Total Sales]
)
ORDER BY 'Date'[Year]What affects loading time
| Factor | Effect |
|---|---|
| Column cardinality | High-cardinality columns need larger dictionaries and take longer to transcode. |
| Number of Parquet files | Many small files slow reading. Compact them with table maintenance. |
| Row group size and V-Order | Files written with V-Order and well-sized row groups load faster. |
| Capacity size | Each capacity SKU has a memory limit and may have limits on rows per table. |
Small-file problems are the most common cause of slow cold starts. A streaming job that commits every few seconds can leave thousands of tiny files. Running optimize compaction on those tables reduces the file count.
Fallback to DirectQuery
Fallback happens when the Direct Lake engine cannot or may not answer a query from loaded or loadable column data. In that case, the query goes through the SQL analytics endpoint of the lakehouse or warehouse, as a DirectQuery query. The result is correct but usually slower, and the query uses source resources.
Common reasons for fallback
- The model reads from a SQL view. Views have no Parquet files for the engine to read, so queries on them always use DirectQuery.
- The warehouse or lakehouse SQL endpoint enforces security that the Direct Lake engine cannot read from files, such as row-level security defined on the SQL endpoint. The engine must go through the endpoint to apply it.
- The table exceeds a limit of the capacity SKU, such as files per table, row groups per table, or rows per table.
- The data in memory would exceed the memory limit of the capacity.
- A feature in the model needs it, such as certain calculated columns or tables that depend on Direct Lake data.
The exact limits depend on the SKU and change over time, so check the current documentation for your capacity.
The DirectLakeBehavior setting
The model property DirectLakeBehavior controls what happens when fallback conditions arise.
| Value | Meaning |
|---|---|
| Automatic | Use Direct Lake when possible. Fall back to DirectQuery when needed. This is the default. |
| DirectLakeOnly | Never fall back. A query that would need fallback fails with an error. |
| DirectQueryOnly | Always use DirectQuery. Useful for testing how queries behave in that mode. |
Which should you pick? Automatic favors availability: reports keep working but may become slow without warning. DirectLakeOnly favors predictability: you see an error and fix the cause. In production models that must be fast, many teams use DirectLakeOnly after testing, so a silent switch to DirectQuery does not go unnoticed. Some newer Direct Lake variants that connect directly to OneLake do not use the SQL endpoint, so they have no DirectQuery fallback at all. Check which variant your model uses.
Detecting fallback
Fallback is invisible in the report. To find it:
- Open Performance Analyzer in Power BI Desktop or the service, and run the visual.
- Look at the visual's DAX query entry. A Direct Lake query shows the storage engine events. A fallback shows a DirectQuery event.
- For deeper detail, use a trace tool such as DAX Studio or SQL Server Profiler connected to the model. Events with a DirectQuery subclass indicate fallback.
- Compare timing across runs. A fallback query is often much slower than a query on warm loaded columns.
A later chapter covers Performance Analyzer in more detail.
How the pieces fit together
The diagram shows what happens from a data load to a user query.
Edge cases and common errors
- Reframing during peak hours. Each reframe clears loaded columns for changed tables. Frequent small loads cause repeated cold starts. Batch your writes where freshness requirements allow.
- Unchanged tables. Tables that did not change between versions generally do not need their columns reloaded, so partitioning your loads by table helps.
- Errors after switching to DirectLakeOnly. A model that worked in Automatic may fail when you change the setting, because it was falling back without anyone knowing. Look for views and endpoint security first.
- Assuming "refresh" means copy. In Direct Lake, a refresh that finishes in seconds is normal. It is framing, not a data load.
- Memory pressure. Wide tables with many high-cardinality columns that users query together can exceed capacity memory. The fix is usually to remove unused columns from the model, not to buy a bigger capacity first.
- Stale reports. If automatic updates are off and no one runs a refresh, the model never moves to the new version.
Summary
Framing pins the model to a Delta table version using metadata only, so it is quick. Column loading reads and converts only the columns that queries need, so the first query on a column pays a cost and later queries are fast. Fallback sends a query through the SQL endpoint when Direct Lake cannot serve it, and DirectLakeBehavior decides whether that is allowed.
Exercise
A Direct Lake report was fast for weeks. After a developer added a SQL view to the lakehouse and pointed one table in the model at it, the visuals using that table became slow. DirectLakeBehavior is Automatic. What is the likely cause, and how can you confirm it and make the problem visible?
Show answer
Tables based on views cannot be read from Parquet files, so queries on that table fall back to DirectQuery through the SQL endpoint. Confirm it by running the visual in Performance Analyzer and checking the query for DirectQuery events, or by tracing the model in DAX Studio. To make the problem visible, set DirectLakeBehavior to DirectLakeOnly so such queries return an error. Then fix the cause by materializing the view into a Delta table and pointing the model at that table.
Exercise
A pipeline loads new data into a Direct Lake table at 02:00. The first report users at 08:00 see slow visuals, but later users do not. Explain why, and name one way to reduce the delay.
Show answer
The reframe after the load discarded loaded columns for the changed table. The first queries must read and transcode the needed columns from Parquet, which is slower than querying columns already in memory. Later users benefit from the loaded columns. To reduce the delay, run representative DAX queries right after the refresh step to warm the model. Compacting small Parquet files can also shorten column loading.