value_nativequery_folding
Run a native SQL query against a source while preserving downstream query folding, ensuring continued performance optimization in Power Query.
Instructions
Run a native query against a source and KEEP downstream folding alive: Value.NativeQuery(sourceExpr, nativeQuery, params, [EnableFolding=true]). sourceExpr is raw M (e.g. a Sql.Database(...) reference). paramsExpr is an optional raw M parameter record/list. Appends one step to the table's M query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| sessionId | Yes | ||
| paramsExpr | No | optional raw M parameter record/list (default null) | |
| sourceExpr | Yes | the source as raw M, e.g. Sql.Database("srv","db") | |
| nativeQuery | Yes | the native (SQL) query text | |
| partitionName | No | partition name (optional; defaults to the first partition) |