Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
akambliViz
Regular Visitor

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 8
Anonymous
Not applicable

Hi @akambliViz ,

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.

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

akambliViz_0-1699342013271.png

 

Anonymous
Not applicable

Hi @akambliViz ,

The official document for this feature don't have this limitation now, so please try it.

vbinbinyumsft_0-1699434099366.png

 

 

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.

Hi @Anonymous ,

 

Thanks for your response. I had already tried this the only problem is unable to bind the date parameter in the DimDate table.

 

Bind to Parameter doesn't show DynamicDate parameter in the list.

 

akambliViz_0-1699447578676.pngakambliViz_1-1699447611454.png

it only shows other two text parameters.

akambliViz_2-1699447695679.png

Could you please assist.

 

Thanks in advance.

miTutorials
Super User
Super User

You can setup a dynamic parameter, please see the below tutorial.

 

Setup Dynamic Parameters to Filter data in your PowerBI Report | MiTutorials - YouTube

@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.

 

akambliViz_0-1699026839163.png

Data source SQL Query date parameters needs to be pass through about date slicer.

akambliViz_1-1699027834014.png

 

 

Uzi2019
Super User
Super User

Hi @akambliViz 
Are you using Direct Query or Import mode???

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Hi @Uzi2019 ,

Thanks for your response.

Currenlty using Import. However how can we achieve this using both Import and Direct query.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.