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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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