Sub topic 2
Keeping Power BI Data Current: Import, DirectQuery, and Direct Lake
Assume you know tables, relationships, basic DAX, and Power BI Desktop. This chapter compares how three storage modes obtain data.
Import refresh
Import mode copies data into Power BI’s in-memory VertiPaq engine. Reports are usually fast because visuals query the copy, not the original database. The copy becomes current only after a refresh.
Incremental refresh avoids reloading the entire table. Create datetime parameters named RangeStart and RangeEnd, then filter the fact table with them:
let
Source = Sql.Database("myserver", "SalesDb"),
FactSales = Source{[Schema = "dbo", Item = "FactSales"]}[Data],
Filtered = Table.SelectRows(
FactSales,
each [OrderDate] >= RangeStart and [OrderDate] < RangeEnd
)
in
FilteredConfigure a policy that stores historical data and refreshes only recent periods. The filter should fold to the source, meaning Power Query sends the date filter to SQL instead of downloading all rows first.
DirectQuery and its trade-offs
DirectQuery keeps the data at the source. When a user opens or filters a visual, Power BI translates the visual’s DAX query into a source query, often SQL.
This can provide fresher data and avoid storing a large copy in the semantic model. However, every interaction adds source load and network latency. Complex visuals can generate expensive queries. Some Power Query transformations, calculated columns, and DAX patterns are restricted or perform poorly because they must translate to the source.
A simple measure may run differently by mode:
Total Sales = SUMX ( Sales, Sales[Quantity] * Sales[UnitPrice] )Direct Lake and Delta tables
Direct Lake is designed for Microsoft Fabric. Fabric tables store data as Delta tables in OneLake. A Direct Lake semantic model reads the required Delta columns directly, loading them into the analytical engine as needed. It avoids the normal Import copy-and-refresh step.
Power BI first uses table metadata, called framing, to understand the Delta data. It then loads columns needed by queries. If a query or table cannot be served through Direct Lake, the model can fall back to DirectQuery, which reintroduces source latency and load.
Exercise
A report needs fast historical analysis, but only the last seven days must be current. Which mode and technique fit?
Show answer
Use Import mode with incremental refresh, keeping history in the model and refreshing the recent partition.