Forum Discussion
Query Folding Stops for Incremental Refreshes
- 5 years ago
"SOLVED"!
I found an interesting half sentence in edhans solution/reply to the following post:
Query Folding & Incremental Refresh"It reads the entire query, then folds everything it can [...]."
Turns out Power BI in my case does not fold the RangeStart and RangeEnd parameter into the query. Why not is an other riddle yet to solve.
But since in my above example, the filtering with RangeStart and RangeEnd was done in the same step as the other filtering, it abandoned the entire filter step.
Now it placed the filtering in two steps.
First my "normal" filtering including STATUS etc.
THEN the filtering on the Range parameters.
And, voila, the "normal" filters are folded back into the query. - 5 years ago
Hi edhans
thanks for your input.
I am not entirely sure though how your date filtering with the date coming from an additional blank query is different from doing the AddDays function as a previous step in the same query like I do for the "normal" date filters shown above (purple frame in screenshot)?
I managed to find the true root cause of the range parameters not folding into the query though.
Now it works!
Check out my spereate thread on this topic.
( Incremental Refresh Should RANGESTART also fold )
"SOLVED"!
I found an interesting half sentence in edhans solution/reply to the following post:
Query Folding & Incremental Refresh
"It reads the entire query, then folds everything it can [...]."
Turns out Power BI in my case does not fold the RangeStart and RangeEnd parameter into the query. Why not is an other riddle yet to solve.
But since in my above example, the filtering with RangeStart and RangeEnd was done in the same step as the other filtering, it abandoned the entire filter step.
Now it placed the filtering in two steps.
First my "normal" filtering including STATUS etc.
THEN the filtering on the Range parameters.
And, voila, the "normal" filters are folded back into the query.
Something else you can do JSiebrecht is have Power Query calculated those variables for you. So a blank query that is:
let
Source = Date.AddDays(DateTime.Date(DateTime.LocalNow()), -3)
in
Source
if you call that varStartDate, then when you have a filter that does this:
Table.SelectRows(TableName, each [Date] < varStartDate)
It will actually do a SQL WHERE clause that feeds the date calculated in varStartDate as a text amount the query folding supports.