This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Solved! Go to Solution.
I have a similar stored procedure where i need to pass along a parameter for start and end dates that i'm calculating in a function.
So my source line looks like:
Source = Sql.Database("MyInstance.database.windows.net", "SQL-DW-PROD", [Query="Exec MyDataBase.[sp_MyProcedure] 0, " & fnStartDate & ", " & fnEndDate", HierarchicalNavigation=true, CommandTimeout=#duration(0, 0, 90, 0)])
Then i have another 2 queries as the functions, named fnStartDate and fnEndDate where i can calculate those exact dates. They can look as based as this:
let
Result = "'2016-01-01'"
in
Result
Or you can get more complex and calculate a date like this:
let
CurrentMonth = Date.Month(DateTime.LocalNow()),
CurrentYear = Date.Year(DateTime.LocalNow()),
Result = Number.ToText(CurrentYear) & "-" & Number.ToText(CurrentMonth) & "-03"
in
Result
I have a similar stored procedure where i need to pass along a parameter for start and end dates that i'm calculating in a function.
So my source line looks like:
Source = Sql.Database("MyInstance.database.windows.net", "SQL-DW-PROD", [Query="Exec MyDataBase.[sp_MyProcedure] 0, " & fnStartDate & ", " & fnEndDate", HierarchicalNavigation=true, CommandTimeout=#duration(0, 0, 90, 0)])
Then i have another 2 queries as the functions, named fnStartDate and fnEndDate where i can calculate those exact dates. They can look as based as this:
let
Result = "'2016-01-01'"
in
Result
Or you can get more complex and calculate a date like this:
let
CurrentMonth = Date.Month(DateTime.LocalNow()),
CurrentYear = Date.Year(DateTime.LocalNow()),
Result = Number.ToText(CurrentYear) & "-" & Number.ToText(CurrentMonth) & "-03"
in
Result
Something to add to this response, depending on how picky your stored procedure is for the date you pass, you could format the date more or change it to a Date Type. I'm concerned with things like whether your stored procedure needs a 2 digit month.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 7 | |
| 7 |
| User | Count |
|---|---|
| 21 | |
| 21 | |
| 18 | |
| 14 | |
| 11 |