Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
We have a native sql query as source, with queryfolding and with a second step to filter a date column for incremental refresh.
We also want to add query hints, such as OPTION (LABEL='small') which is a classifier for sql pools to assign less resources to the query.
The problem is: the query hint should be at the END of the query, and do to queryfolding, the hint gets wrapped as a subquery and therefore the hint is not at the end, thus throwing an error.
Any ideas? Why would sql.nativequery not support extra parameters for these query options?
https://learn.microsoft.com/en-us/sql/t-sql/queries/option-clause-transact-sql?view=sql-server-ver16
Hi @Devale1
To resolve the issue of placing SQL query hints at the end when using query folding with incremental refresh:
Query Folding Behavior:
Issue:
Disable Query Folding for Incremental Refresh:
Manually Add the Query Hint:
Alternative Approach:
This should allow you to properly use the query hint in your SQL query. Let me know if you need further clarification!
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Please Subscribe my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
Include the RangeStart and RangeEnd filter as part of the native query.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |