Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I have several native queries I'm using to get data into Power BI from SQL Server (using SQL statements - advanced option). Some of my native queries are complex - some include joins or performing counts. I'm unable to achieve query folding (at least according to this method here) - I get an error saying the query cannot be folded.
I would like to know if queries as complex as this can achieve query folding? I'm finding the only way to do this effectively is to have a view created and having a "select *" to get that data. Ultimately, I am trying to achieve incremental refresh. Any advice would be great!
If you can't get folding to occur with Value.NativeQuery, you can always create datetime parameters called RangeStart and RangeEnd and concatenate those into your SQL statement WHERE clause too. This video shows an example - (1) Natives Queries or ODBC with Incremental Refresh in Power BI - YouTube
Pat
Hi @ppm1 , I tried following the video you shared by creating a dataflow but I run into the error below while trying to authenticate for it. My database is on-prem... could this be a reason why I am unable to achieve query folding for incremental refresh?
Can you get it to work in a query in Power BI Desktop? Is the issue only when you try it via Dataflow? If so, do you have a gateway set up?
Pat
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 |