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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sprasad
Helper II
Helper II

Parameterize and accept user input

Hi

 

I have 2 seperate graphs on page Page A and Page B. I use SQL Query to fetch data and represent it on the graph on Page A and page B. The SQL query used for Page A and Page B are same except that the condition varies by Product 1 and product 2 e.g Query for Page A can be like "Select * from <table> where product = Product 1" and Query for Page B can be like "Select * from <table> where product = Product 2".

I want to Parameterize with a single user input for the Product 1 and Product 2 values and accept the user input as Product X. So when a user enters the value as Product 1 the graph should get update in Page A and when the user enters the Value as Product 2, the graph on Page B should get updated. Is it possible to acheieve this and if so how can we do it.

 

Thanks

Sudhir

3 REPLIES 3
v-danhe-msft
Employee
Employee

Hi @sprasad,

Based on my test, It is possible to achieve it, you can create the different parameters and queries to filter the table. You can refer to below steps:

1.Create two parameters and set the “Current Value”

A.PNG

2.Create two queries to relate the parameters.

Query1= Sql.Database("<ServerName>", "TSQLV3", [Query="select * from Calendar2 where year ='"&Parameter1&"'"])

Query2= = Sql.Database("<ServerName>", "TSQLV3", [Query="select * from Calendar2 where year ='"&Parameter2&"'"])

3.Now you can see the result.

B.PNG

C.PNG

4.You can use the data of “Query1” in your page A and use the data of “Query2” in your page B. Now you can enter the different parameters to show your different data.

D.PNG

Regards,

Daniel He

 

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Daniel,

Thanks for your reply and solution. In fact this is the way I am currently querying by using different variables for the queries in different page/tabs.
But I want to optimize on the input parameters since I end up in entering many input values as there are 5 different pages. So I wanted to input one value in Parameters and according to the Input value it should go to the correct page and sit in the query string for that tab. Again I want to emphasize on my requirement/condition: "So when a user enters the Value as Product 1 the graph should get updated in Page A and when the user enters the Value as Product 2, the graph on Page B should get updated." And I should have only one Parameter variable for "Value"

 

Thanks

sprasad
Helper II
Helper II

Any clue or any help on this will be very much appreciated.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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