Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hello everyone,
I have a script which fetches up data from an SQL server(particular table). The are plenty of projects on the server, so I want to make the project id "dynamic".
I have created one dynamic parameter, which is text.
Could you please assist me on how should I insert it to script.
I have tried "&projectid"(described in attached photo), but I get error that "incorrect syntax near &"
Solved! Go to Solution.
Hi, by parameter i ment a variable part of a query. Just create empty query and in the formula bar enter project id. This query will be your parameter to be used in building sql statement.
Artur
Hi, by parameter i ment a variable part of a query. Just create empty query and in the formula bar enter project id. This query will be your parameter to be used in building sql statement.
Artur
Thank you very much. I have just entered parameter as '"&projectid&"'(as you did) and it worked
Hi,
Create query and call it e.g. Project_ID_par
Create query and in the first step create query text by using name of first query as parameter and in the second step connect to the databse and execute query.
let
Source = "select 8 from table_name wherer project_id='" & Project_ID_par & "'",
Custom1 = Odbc.Query("dsn=DSNName", Source)
in
Custom1
Hope this will help.
Artur
Hello Artur,
Thanks for your detailed explanation.
If I understood correctly, I have to create 2 queries and 2nd one should point to the first one.
I have tried to create query from "manage parameters => new parameter".
However, the query field is disabled.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |