Forum Discussion
How to pass dynamic date parameter to SQL query through slicer or any alternate solution
Hello Team,
There is a requirement of passing a date picker parameter to the report dataset to fetch only the data for that specific date(Single datepicker).
The data is more than 3Million rows which needs to be populated using a SQL query where the date parameter needs to be given by User and then only the query needs to be hit to the DB to fetch the data only for that particular date.
How can we achive the dynamic parameter which will be selected by User as a single date picker and will be pass in the where clause of the SQL query to fetch only that data for that particular date?
Thanks in advance.
8 Replies
- Uzi2019Community Champion
Hi Anonymous
Are you using Direct Query or Import mode???- AnonymousNot applicable
Hi Uzi2019 ,
Thanks for your response.
Currenlty using Import. However how can we achieve this using both Import and Direct query.
- miTutorialsSuper User
You can setup a dynamic parameter, please see the below tutorial.
Setup Dynamic Parameters to Filter data in your PowerBI Report | MiTutorials - YouTube
- AnonymousNot applicable
miTutorials Thanks so much for your response. In the video the date parameters are selected before loading the resport. However the requirement is to select the single date slicer from home page and then on button click fetch the data only for that selected date.
Data source SQL Query date parameters needs to be pass through about date slicer.
- AnonymousNot applicable
Hi Anonymous ,
Please refer this document: Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
Hope it is helpful for you.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- AnonymousNot applicable
Hi Anonymous ,
Thanks for your response.
I had already went through this link however there are limitation for Direct Query for SQL Server Datasource. Please check below snippet due to which the power bi doesn't show bind to parameter property in Advance section. 😞
Link for the reference.
Bind to parameter not showing in Modeling tab if w... - Microsoft Fabric Community
- AnonymousNot applicable
Hi Anonymous ,
The official document for this feature don't have this limitation now, so please try it.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.