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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mbecker0416
New Member

Choose 1 or many ODBC sources

I've set up many ODBC data sources on my local machine. I am attempting to run a query against one or many databases at the same time. I'm able to hard code this, but i would like to automate it, and cannot find the solution. I made my SQL statement into a paramater and can pass that without issue, and I've built a listbox to select 1 or many connections and pass that to a delimited string. I've tried passing the value "Odbc.Query("dsn=db1", SetQuery) & Odbc.Query("dsn=db2", SetQuery)" as a variable, but this returns plain text, the functions are not called when pass as variables. Is there a method to loop through and connect only to those sources that ive choosen?

 

let
Source = Odbc.Query("dsn=db1", SetQuery) & Odbc.Query("dsn=db2", SetQuery) 

in
Source

 

Thanks,

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi 

You may need use each DB name as one of the list values of the parameter which can be used in Power Query (Query Editor->Advanced Editor) and concatenate into entire MDX query string to retrieve data.

For more details, please refer to article below:

Dynamic data masking and query parameters

 

Best Regards

Maggie

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.