Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.