Sub topic 10
Verifying Results and Fixing Common Problems
This chapter assumes you can already build an incremental refresh setup: you know Power Query, you have created the RangeStart and RangeEnd parameters, and you have defined a refresh policy. Here you check that the setup works and fix the usual failures.
What "working" looks like
A healthy setup has three signs:
- The filter on
RangeStartandRangeEndfolds to the source, so each partition query reads only its own date slice. - After the first service refresh, the table has one partition per period in the policy.
- Later refreshes touch only the incremental partitions, and they run much faster than the first one.
The diagram shows the order of the checks. Start at the top and stop at the first failure.
Check 1: query folding
Folding means Power Query translates your steps into one native query, such as SQL, and the source runs it. Without folding, Power BI downloads the whole table and then filters it in the mining engine. The refresh still succeeds, but every partition reads everything, which defeats the purpose.
In Power Query Editor, right-click the filter step in Applied Steps.
- If View Native Query is available, the step folds.
- If it is greyed out, the step does not fold.
Consider this filter:
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 native query should contain a WHERE clause on OrderDate. Any step added after the filter can also break folding, so check the last step too. Moving a non-folding step before the filter does not help, because folding stops at the first step that cannot fold.
Check 2: the partitions in the service
After you publish and refresh, open the table in SQL Server Management Studio through the XMLA endpoint, which needs Premium, Premium Per User, or Fabric capacity. Under the table, list the partitions. You should see yearly archive partitions, a monthly or daily set for recent periods, and daily partitions for the incremental window. If you see a single partition, the policy was not applied. Refresh the published model again in the service. Desktop does not create the partitions.
Check 3: the source
Look at the source query log or monitoring tool during a refresh. Each partition should send a query with a narrow date range. A query with no date predicate means folding failed.
Common problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Refresh policy option is greyed out | Parameters are not named exactly `RangeStart` and `RangeEnd`, or are not Date/Time | Recreate them with the exact names and type |
| First refresh runs out of memory or time | The first refresh loads the full archive period | Reduce the archive range for the first run, or refresh partitions in batches by using the XMLA endpoint |
| Every refresh takes as long as before | The filter does not fold | Fix folding as described above |
| Rows appear twice | Filter uses `>=` and `<=` on both ends | Use `>=` on one side and `<` on the other |
| Rows are missing | The filtered column differs from the policy's date column, or the date is stored as an integer | Filter on the same column, and convert the parameters for an integer key |
| Refresh fails after a source schema change | Existing partitions were built for the old schema | Republish and run a full refresh |
For an integer date key such as 20200101, convert the parameters to the same format before filtering:
let
Source = Sql.Database("myserver.database.windows.net", "SalesDb"),
FactSales = Source{[Schema = "dbo", Item = "FactSales"]}[Data],
StartKey = Date.Year(RangeStart) * 10000 + Date.Month(RangeStart) * 100 + Date.Day(RangeStart),
EndKey = Date.Year(RangeEnd) * 10000 + Date.Month(RangeEnd) * 100 + Date.Day(RangeEnd),
Filtered = Table.SelectRows(FactSales, each [DateKey] >= StartKey and [DateKey] < EndKey)
in
FilteredReading the refresh history
In the dataset's refresh history, a first refresh can take hours and later ones minutes. If a later refresh is as slow as the first, go back to Check 1. If a refresh fails partway, the partitions that finished stay as they were, and the next run retries the failed ones.
Exercise
A refresh policy keeps 5 years and refreshes the last 10 days, yet every scheduled refresh takes as long as the first. The Applied Steps pane shows View Native Query greyed out on the date filter step. What is the cause, and what do you do?
Show answer
The filter step does not fold, so each partition query downloads the entire table and filters it in Power BI. Find the step that breaks folding, such as a custom function or a transformation the source cannot run. Remove it, move the work into a source view, or rewrite it as a foldable step, then confirm that View Native Query is available on the filter step, and republish.
Exercise
You see duplicate rows in the service for orders at midnight on the first day of each month. Which filter mistake is the most likely cause?
Show answer
The filter uses >= and <= on the two range parameters, so a row at exactly RangeEnd lands in two adjacent partitions. Use >= RangeStart and < RangeEnd.