Forum Discussion
Using SQL declared variables into Power BI
- 1 year ago
Thankyou, MohamedFowzan1, CPCARDOSO, kushanNa for your responses.
Hi cheid_4838,Based on my understanding, in Import mode parameters can only be applied during refresh and cannot be bound to slicers. Consequently, the Bind to Parameter option does not appear. In DirectQuery mode, dynamic M parameters are supported; however, the current SQL query contains unsupported constructs such as correlated subqueries and ORDER BY in subqueries. These constructs break query folding, preventing DirectQuery from executing the query in its present form.
If you remain in Import mode, parameters will work only at refresh time and will not be dynamic. If you require slicer driven parameters, switch to DirectQuery and simplify the SQL by using a database view or stored procedure that accepts parameters. This will enable query folding and allow binding slicers to parameters.
Additionally, please refer to the following links:
Value.NativeQuery - PowerQuery M | Microsoft Learn
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft LearnWe hope this information helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
Thankyou, MohamedFowzan1, CPCARDOSO, kushanNa for your responses.
Hi cheid_4838,
Based on my understanding, in Import mode parameters can only be applied during refresh and cannot be bound to slicers. Consequently, the Bind to Parameter option does not appear. In DirectQuery mode, dynamic M parameters are supported; however, the current SQL query contains unsupported constructs such as correlated subqueries and ORDER BY in subqueries. These constructs break query folding, preventing DirectQuery from executing the query in its present form.
If you remain in Import mode, parameters will work only at refresh time and will not be dynamic. If you require slicer driven parameters, switch to DirectQuery and simplify the SQL by using a database view or stored procedure that accepts parameters. This will enable query folding and allow binding slicers to parameters.
Additionally, please refer to the following links:
Value.NativeQuery - PowerQuery M | Microsoft Learn
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
We hope this information helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.