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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Multiple value in parameter with direct query

Good evening, I have a problem:

I have thi sql statement

select * from table1 where field1 in (parameter)

The parameter can has two or more value, for example parameter = ('A','B','C')

In the sql oracle I don't have any problem but:

"I must use direct query for import the data, how I can introduce multiple value in parameter?"

I usually use this statement

1 - I create a parameter in power bi desktop

2 - I take the sql statement and use '" &parameter& "' in the parameter 

 

In particular:

select * from table1 where field1 in ('"  &nameParameterPowerBi&"')

 

You can help me?

Thank you

 

Best regards

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found a solution.

It is enough to remove the ' in the query sql when I write the sql statement.

So my sql statement with parameter become:

select * from table1 where field in (" &paramenter& ")

and in the parameter in power bi I add 'value','value', so it will become in the direct query when it run

select * from table1 where field in ( 'value','value')

 

Best regard

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Are you looking for this option

https://community.powerbi.com/t5/Desktop/parameterize-connection/m-p/205900#M90712

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

I found a solution.

It is enough to remove the ' in the query sql when I write the sql statement.

So my sql statement with parameter become:

select * from table1 where field in (" &paramenter& ")

and in the parameter in power bi I add 'value','value', so it will become in the direct query when it run

select * from table1 where field in ( 'value','value')

 

Best regard

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.