Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sedareports
Advocate II
Advocate II

Incremental Refresh with Non Native Query Transformations

Can I still utilize incremental refresh as long as a execute the incremental refresh (RangeStart/End parameters) before I break my query folding with a bunch of transformations? My dataset is pretty large, and incremental refresh is hard to test as the intial load regularly fails.

 

I was thinking that maybe it depends on the kind of transformations, so here are a few examples of what I am using:

 - merge queries to bring in key attributes from other tables

 - add a calculated column

 - remove duplicates

 - sort rows after removing records in order to add a clean index (i.e. one that can be used later in DAX to calc differences between records).

5 REPLIES 5
Anonymous
Not applicable

Hi @sedareports ,

The prerequisite for incremental refresh to work properly is that the data source used must support query folding. Most data sources that support SQL queries support query folding. Please check whether the following documentations can help you resolve your problem.

Dealing with Large Datasets

CHECKING QUERY FOLDING WITH VIEW NATIVE QUERY

Query Folding & Incremental Refresh

Not Folding; the Black Hole of Power Query Performance

Best Regards

Rena

Thanks @Anonymous for the reference links. I should have clarified, my initial query can be folded. But subsequent transformations (after the folding and using RangeStart/RangeEnd) are performed. My question is what transformations after a query fold that would still cause the entire querying of the dataset (i.e. igore the query folding?)

 

 

query folding stops with the change type transformation:

let
    StartDate = "'"&DateTime.ToText(RangeStart)&"'",
    EndDate = "'"&DateTime.ToText(RangeEnd)&"'",
    SCADATags= "(" & Text.Combine(List.Transform(#"3SCADAFlowTags"[SCADAID], each "'"&_&"'"),",") & ")",
    Source = Odbc.Query("Driver={PostgreSQL ANSI(x64)};server=XXXX;port=5432;Database=XXXX", "SELECT * FROM XXXXX where scadaid in "&SCADATags&" and measurementdatetime >= "&StartDate&" and measurementdatetime < "&EndDate&" and measurementquality = '100'"),
  //query folding stops 
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"measurementvalue", type number}}),
    #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"scadaid"}, #"3SCADAFlowTags", {"SCADAID"}, "SCADAFlowTags", JoinKind.FullOuter),
    #"Expanded SCADAFlowTags1" = Table.ExpandTableColumn(#"Merged Queries", "SCADAFlowTags", {"Description", "FromServiceArea", "MeterError", "ToServiceArea"}, {"Description", "FromServiceArea", "MeterError", "ToServiceArea"}),
    #"Added Custom" = Table.AddColumn(#"Expanded SCADAFlowTags1", "Date", each DateTime.Date([measurementdatetime])),
    #"Changed Type2" = Table.TransformColumnTypes(#"Added Custom",{{"MeterError", type number}}),
    #"Meter Error Calc" = Table.AddColumn(#"Changed Type2", "Multiplication", each -1*[measurementvalue]/(1+[MeterError]), type number),
    #"Renamed Columns" = Table.RenameColumns(#"Meter Error Calc",{{"Multiplication", "measurementvaluefinal"}}),
    #"Removed Duplicates1" = Table.Distinct(#"Renamed Columns", {"scadaid", "measurementvalue", "measurementdatetime","Description"}),
    #"Filtered Rows" = Table.SelectRows(#"Removed Duplicates1", each ([scadaid] <> null)),
    #"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"scadaid", Order.Ascending}, {"measurementdatetime", Order.Ascending}}),
    #"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Index", 0, 1),
    #"Removed Columns" = Table.RemoveColumns(#"Added Index",{"ToServiceArea","measurementtype","networkfacilityid","measurementquality","objectid"}),
    #"Renamed Columns1" = Table.RenameColumns(#"Removed Columns",{{"FromServiceArea", "ServiceArea"}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns1",{{"Date", type date}}),
    #"Removed Columns1" = Table.RemoveColumns(#"Changed Type1",{"MeterError"})
in
    #"Removed Columns1"

 

 

 

 

Anonymous
Not applicable

Hi @sedareports ,

I'm so sorry I'm not clear about your problem. Could you please provide more details on it?

Best Regards

Rena

My question/problem is, can a user perform transformations after a query folding and still maintain incremental refresh? I.e. will the subseqent tranformations only be applied to new incrementally loaded data, or will they possible trigger a full query/processing of the entire data set.

For example.. a sorting transformation or applying an index. 

Anonymous
Not applicable

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.