Modifying Incremental Refresh
- ❌
Desktop Edition - ✔ Business Edition
- ✔ Enterprise Edition
Incremental Refresh is changed by adjusting the Refresh Policy properties. Depending on what you want to change, you will adjust a different property. A full overview of these properties is here.
Important
Setting up Incremental Refresh with Tabular Editor 3 is limited to dataset hosted in the Power BI Datasets service. For Analysis Services custom partitioning is required.
Change Incremental Refresh
Below is a general description of how you modify an existing Refresh Policy:
Connect: Connect to the model.
Select the Table: Select the table already configured for Incremental Refresh.
Find 'Refresh Policy' properties: In the Properties window, go to the Refresh Policy section.
Change the property: Change the Property specified in the below sections, depending on what you want to change. For an overview of all Refresh Policy properties and what they do, see here.
Apply Changes: Deploy the model changes.
Apply Refresh Policy: Right-click the table and select Apply Refresh Policy.
Refresh all partitions: Shift-click to select all partitions. Right-click and select Refresh > Full refresh (partition). You can right-click the table and select 'Preview data' to see the result.
Below is an overview of common changes one might make to an existing Refresh Policy:
Extend or Reduce the Window for Archived Data
Purpose: Add or reduce the amount of data in the model.
Property: RollingWindowPeriods. Increase to extend the window (more data); decrease to reduce the window (less data).
Note: You can also change the RollingWindowGranularity to make a more fine-grain selection, i.e. from 3 Years to 36 Months.
Extend or Reduce the Window for Refreshed Data
Purpose: Add or reduce the amount of data being refreshed in a scheduled refresh operation.
Property: IncrementalWindowPeriods. Increase to extend the window (more data); decrease to reduce the window (less data).
Note: You can also change the IncrementalWindowGranularity to make a more fine-grain selection, i.e. from 3 Years to 36 Months.
Only Refresh Complete Periods
Purpose: Exclude partial (incomplete) periods from the Rolling Window
Property: IncrementalWindowPeriodsOffset. Set the value to -1
to offset the period by 1, excluding the current period.
Note: You can further offset this window to refresh i.e. only the periods behind the most recent complete period.
Change Incremental Refresh Mode
Purpose: To change from Import
to Hybrid
tables, or vice-versa.
Property: Mode
Note: Follow the below process to change Incremental Refresh Mode:
- Change Mode to the desired value
Import
orHybrid
- Right-click the table and select Apply Refresh Policy
- Deploy the model changes
- Shift-click to select all partitions. Right-click and select Refresh > Full refresh (partition). You can right-click the table and select 'Preview data' to see the result.
Note
It is recommended to check that the Rolling Window is appropriately set for the selected Mode. When switching from Import
to Hybrid
Mode, the latest Policy Range Partition will become the DirectQuery partition. You may wish to opt for a more fine-grain window, to limit the amount of data queried with DirectQuery.
Configure 'Detect Data Changes'
Purpose: To configure that archived data will refresh if the value of a date column (i.e. LastUpdate) changes.
Property: PollingExpression. Add a valid M Expression which returns a maximum date value for a column. All records containing that date will be refreshed, irrespective of their partition.
Note: Follow the below process to configure 'Detect Data Changes':
- When the table is selected, in the Expression Editor window, select Polling Expression from the top-left dropdown
- Copy in the below M Expression, replacing LastUpdate with your desired column name.
// Retrieves the maximum value of the column [LastUpdate]
// Replace LastUpdate with your own column name
// The data will refresh for any records where the value in this column
// equals the maximum value in the column across the entire table
let
#"maxLastUpdate" =
List.Max(
// Replace the below with your column and table name
Orders[LastUpdate]
),
accountForNu11 =
if #"maxLastUpdate" = null
then #datetime(1901, 01, 01, 00, 00, 00)
else #"maxLastUpdate"
in
accountForNu11
- Right-click the table and select Apply Refresh Policy
- Deploy the model changes
- Shift-click to select all partitions. Right-click and select Refresh > Full refresh (partition). You can right-click the table and select 'Preview data' to see the result.
Warning
Any records will update if the value equals the maximum value in the column. It does not necessarily update explicitly because the value has changed, or if the value equals the refresh date.
Applying refresh policies with EffectiveDate
If you want to generate partitions while overriding the current date (for purposes of generating different rolling window ranges), you can use a small script in Tabular Editor to apply the refresh policy with the EffectiveDate parameter.
With the incremental refresh table selected, run the following script in Tabular Editor's 'New C# Script' pane instead of applying the refresh policy by right-clicking the table.
// Todo: replace with your effective date
var effectiveDate = new DateTime(2020, 1, 1);
Selected.Table.ApplyRefreshPolicy(effectiveDate);
Disabling Incremental Refresh
Purpose: To disable a refresh policy because it is not needed or the use-case no longer fits.
Property: EnableRefreshPolicy
Note: To disable Incremental Refresh, follow the below steps:
- Copy the Source Expression: With the table selected, in the Expression Editor window, select Source Expression from the top-left dropdown. Copy the Source Expression to a separate text editor window.
- Disable the Refresh Policy: Change EnableRefreshPolicy to
False
- Remove all Policy Range partitions: Select and delete all of the Policy Range partitions
- Create a new M Partition: Right-click the table and select Create > New Partition. Set the partition kind property to
M
. - Paste the Source Expression: Copy the Source Expression from Step 6 into the Expression Editor as the M Expression when selecting the new partition.
- Apply Changes: Deploy the model changes.
- Refresh the Table: Select and right-click the table. Select Refresh > Full refresh (table). You can right-click the table and select 'Preview data' to see the result.