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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
jjhendrickson
Frequent Visitor

Incremental Refresh Using Stored Procedure, Parameters Not Overridden in Power BI Service

Hello,
I am attempting to use configure incremental refresh on dat retrieved from a stored procedure. I have set up my RangeStart and RangeEnd parameters as date/time and set them one day apart. Then I wrote the following M code to load data from the SP.

 

 

 

let
    Source = Sql.Database("myConnectionString", "myDatabase",[CommandTimeout=#duration(0, 2, 0, 0)]),
    NativeQuery = Value.NativeQuery
        (
            Source,
            "
            EXEC mySchema.myStoredProcedure
                @startDate,
                @endDate,
                @return
            ",
            [startDate=RangeStart,endDate=RangeEnd,return="Screenings"],
            [EnableFolding=true]
        )
in
    NativeQuery

 

 

 

The @return variable here determines which dataset in returned from the SP execution.
I then set up inceremental refresh on the table, choosing three years for the archive and 10 days from the increment.

jjhendrickson_0-1739555414074.png

The refresh works just fine is desktop and I see one day of data as expected. However, after publishing to the Power BI Service and triggering an initial refresh. I do not see data from the full archive period as expected. Instead, I still only see only the one day of data that the RangeStart and RangeEnd parameters - as configured in the desktop file - allow. This persists after multiple refresh attempts. Essentially, the Power BI Service does not seem to be overridding the incremental refresh parameters based on the incremental refresh configuration.

Additional Notes:
This table is used as a source for other tables in the semantic model (referenced)

This table is hidden in my semantic model (load is enabled)
My SP variables startDate and endDate are of the data type datetime

2 ACCEPTED SOLUTIONS

correct. They don't know anything about the query that runs on that table.  Don't use them, find another way, for example via the data model.

View solution in original post

jjhendrickson
Frequent Visitor

I found this workaround. Re: incremental refresh on table by reference - Microsoft Fabric Community , which fixes the issue by passing the incremental refresh parameters to dummy variables in the reference table queries. With the dummy variables in the reference queries, Incremental Refresh configurations can be applied (there will be a warning that query folding can't be confirmed). After publishing and refreshing, all tables now have partitions and the correct amount fo data.

View solution in original post

6 REPLIES 6
jjhendrickson
Frequent Visitor

I found this workaround. Re: incremental refresh on table by reference - Microsoft Fabric Community , which fixes the issue by passing the incremental refresh parameters to dummy variables in the reference table queries. With the dummy variables in the reference queries, Incremental Refresh configurations can be applied (there will be a warning that query folding can't be confirmed). After publishing and refreshing, all tables now have partitions and the correct amount fo data.

lbendlin
Super User
Super User

How many partitions have been created for that table?

Good prompt. I connected via SSMS to the XMLA endpoint and saw that the table loaded from the SP actually does have multiple partitions and the correct amount of rows. This table is hidden in my semantic model because it is a staging table for two other tables that use it as a referenced source. Both of these tables have no partitions and only have data for the one day. It seems that reference tables do not "inherit" the incremental refresh settings from the source table?

correct. They don't know anything about the query that runs on that table.  Don't use them, find another way, for example via the data model.

Thanks, this knowledge helped me to discover a workaround. 

Don't do it. Get rid of the need for these tables.  The "may not fold"  warning has a reason - you may negate the performance benefits of the fully folded incremental refresh, and all you get is partition management. 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.