This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. 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?
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 31 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 74 | |
| 61 | |
| 31 | |
| 31 | |
| 23 |