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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

How to insert Dynamic parameter to script

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 &"

 

yusif1999_0-1655828480392.png

 

1 ACCEPTED SOLUTION
artpil
Resolver II
Resolver II

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

View solution in original post

4 REPLIES 4
artpil
Resolver II
Resolver II

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

Anonymous
Not applicable

Thank you very much. I have just entered parameter as '"&projectid&"'(as you did) and it worked

artpil
Resolver II
Resolver II

Hi,

 

Create query and call it e.g. Project_ID_par

artpil_0-1655830678397.png

 

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

Anonymous
Not applicable

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.

yusif1999_0-1655890693471.png

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.