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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Siboska
Helper II
Helper II

Using query hint in Value.NativeQuery SQL statement

Hi, 

Is it somehow possible to add a SQL query hint like "OPTION (FORCE ORDER)" into an sql statement were i'm activating QueryFolding=true?

Example:
"SQL STATEMENT...OPTION (FORCE ORDER)", null,[EnableFolding=true])

When I try it will throw this error:
DataSource.Error: We cannot fold on top of this native query. Please modify the native query or remove the 'EnableFolding' option.

1 REPLY 1
cpwebb
Microsoft Employee
Microsoft Employee

Probably not, because the SQL you enter in Value.NativeQuery gets used in a subquery, similar to what happens in DirectQuery mode as I described here: https://blog.crossjoin.co.uk/2022/03/06/why-not-all-sql-queries-can-be-used-as-a-source-in-power-bi-...), and the OPTION clause can be used inside a subquery (assuming you're writing TSQL: https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query?view=sql-server-ver16#r...).

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors