Sub topic 1
Why Full Refresh Does Not Scale
Prerequisites
Assume you can connect Power BI Desktop to a relational source, use Power Query, and load a table in Import mode. You should also know that Import mode stores a copy of source data in the Power BI model.
Why Full Refresh Does Not Scale
A full refresh reads every row from the source, transforms the rows, and rebuilds the model data. This may work for a small table. For a fact table with billions of historical rows, it increases source load, network traffic, refresh time, and memory use.
Incremental refresh changes the amount of work. Historical data is kept in larger, older partitions. Only recent partitions are reloaded. A partition is a separate section of a table that Power BI can refresh independently.
Query Folding: The Requirement Behind Incremental Refresh
Query folding is the process in which Power Query translates steps into a query that the source can execute. Incremental refresh depends on folding because the source must filter rows before sending them to Power BI.
If the date filter does not fold, Power BI may read the entire table and filter it locally. That removes much of the performance benefit. Check folding by right-clicking the filter step in Power Query and selecting View Native Query, when the connector supports it.
A reliable filter uses an inclusive start and an exclusive end:
let
Source = Sql.Database("myserver.database.windows.net", "SalesDb"),
FactSales = Source{[Schema = "dbo", Item = "FactSales"]}[Data],
Filtered = Table.SelectRows(
FactSales,
each [OrderDate] >= RangeStart and [OrderDate] < RangeEnd
)
in
FilteredThe two comparisons prevent a row at the boundary from appearing in two partitions.
Creating the RangeStart and RangeEnd Parameters
Create two Power Query parameters with these exact names:
RangeStartRangeEnd
Both parameters must use the Date/Time type. Their development values define the limited slice loaded in Power BI Desktop. They do not define the final archive or refresh window.
RangeStart = #datetime(2020, 1, 1, 0, 0, 0)
RangeEnd = #datetime(2020, 2, 1, 0, 0, 0)Use the parameters in the table's date filter. Later, the refresh policy replaces these values with partition-specific ranges.
Exercise
Why should the filter use >= RangeStart and < RangeEnd instead of two inclusive comparisons?
Show answer
The exclusive end prevents a boundary row from belonging to two adjacent partitions.