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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
shahid_tanmoy00
Regular Visitor

Using textbox input in Sql source Query possible?

Hi All :), 

 

I have a sql query that is connected to sql database server. 
I have a sql code that runs on a refresh but I want I want to build a tool out of it that restricts the code to whatever order number the user is looking for information about. 

 

I feel like this is not a thing in PowerBI but is there anyway a dax code in advanced editor can reference a textbox that is on the dashboard that a user has inputed a order number too. powerbisqlhelp.png

1 REPLY 1
Anonymous
Not applicable

Hi @shahid_tanmoy00 ,

 

You can connect to your data source by clicking "get data" on the power bi desktop, and then enter the sql query in the "sql statement" as shown below. You can also use a SqlDataSource control with parameterized queries and assign parameter values from predefined sources or programmatically.

vtangjiemsft_0-1685331006853.pngvtangjiemsft_1-1685331026095.pngvtangjiemsft_2-1685331071766.png

 

 

Please refer to the following document for more information.

Using Parameterized Queries with the SqlDataSource (VB) | Microsoft Learn

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.