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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I have a direct connection to an SQL Server via my powerbi report. In advanced editor I have the following:
let
Source = Sql.Database("Server\Database", "Database", [Query="Select * from queryinsql(" & Number.ToText(PeriodParameter) & "," & Number.ToText(YearParameter) & ")"])
in
SourceI've 2 parameters I'm passing to the query, period and year. I don't want the users to enter these parameters themselves in the query editor and would like if these parameters were available on the report level.
I followed this link, creating a table for period and another one for year but it seems it doesn't support SQL queries. https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters
Has anyone any advice please?
Thanks.
Solved! Go to Solution.
Hi @JohnLow ,
If you have a sql connection using direct query mode, as the document mentioned the dynamic M query could not suppport in this comection.
The feature is only supported for M based data sources. The following DirectQuery sources are not supported:
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @JohnLow ,
If you have a sql connection using direct query mode, as the document mentioned the dynamic M query could not suppport in this comection.
The feature is only supported for M based data sources. The following DirectQuery sources are not supported:
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@JohnLow , There was feature in OCT 2020- https://powerbi.microsoft.com/en-us/blog/power-bi-october-2020-feature-summary/#_Toc51665421
https://blog.crossjoin.co.uk/2020/12/06/using-power-bi-dynamic-m-parameters-in-dax-queries/
See if that can help
@amitchandak, This all refers to dynamic m parameters though, I have an SQL query?
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 60 | |
| 53 | |
| 40 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 97 | |
| 81 | |
| 35 | |
| 29 | |
| 25 |