Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All
i am trying to setup a dynamic M query parameter with snowflake and date field.
i have created the parameter in report and trying pinning in the query but somehow it always shows syntax error.
the parameter name is AsOfDate
appreciate your help in this
Solved! Go to Solution.
Hi @
Try something like below:
let
AsOfDateParam = AsOfDate,
FormattedDate = Date.ToText(AsOfDateParam, "yyyy-MM-dd"),
Source = Sql.Database(
"YourServerName",
"YourDatabaseName",
[
Query = "
SELECT OrderID, CustomerID, OrderDate, TotalAmount
FROM Sales
WHERE OrderDate >= '"
& FormattedDate
& "'"
]
)
in
Source
Hi @swrlabhe,
Thank you for reaching out to the Microsoft fabric community forum. Also thanks to @danextian, @lbendlin, for those valuable insights on this thread. I reproduced the scenario, and it worked on my end. I used my sample data and successfully implemented it.
From snowflake I take server name from account shown in the image and warehouse name is COMPUTE_WH.
outcome:
I perfectly executed the Dynamic M query with the sample data, you can verify the below .pbix file.
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Hi @swrlabhe,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @swrlabhe,
Hope you had a chance to try out the solution shared earlier. Let us know if anything needs further clarification or if there's an update from your side always here to help.
Thank you.
Hi @swrlabhe,
Just wanted to follow up one last time. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.
Thank you.
Hi @
Try something like below:
let
AsOfDateParam = AsOfDate,
FormattedDate = Date.ToText(AsOfDateParam, "yyyy-MM-dd"),
Source = Sql.Database(
"YourServerName",
"YourDatabaseName",
[
Query = "
SELECT OrderID, CustomerID, OrderDate, TotalAmount
FROM Sales
WHERE OrderDate >= '"
& FormattedDate
& "'"
]
)
in
Source
Sorry replying from slightly different login ,
I ahve below M query code which says 0 errors detected
Direct query
Is your SnowFlake connection in Direct Query or in Import Mode?
I have the connection in Import
Dynamic M Query parameters only work for Direct Query data sources.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
67 | |
51 | |
38 | |
26 |
User | Count |
---|---|
89 | |
52 | |
45 | |
39 | |
38 |