I can get the stored procedure to run if I type in a date such as 10/22/2021. But I want the date to default to the current date when the data is refreshed.
Forum Discussion
BARNESL
4 years agoRegular Visitor
I am using a stored procedure that has a date parameter to retrieve data for a power bi report.
I am using a stored procedure that has a date parameter to retrieve data for a power bi report. I want the date parameter to default to today's date.
1 Reply
- BA_Pete
Super User
Hi BARNESL ,
You may need to provide your code for this but, based on my initial interpretation, it looks ike this might be solved as follows:
If the SP is on SQL server and the date is hardcoded within it, you could find the hardcoded date and swap it for
CAST(GETDATE() AS DATE)If only Power Query is providing the parameter, you could update the M code to provide the following instead of a user-entered/hardcoded date:
Date.From(DateTime.LocalNow())Pete