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

Join 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.

Reply
BanNguyen
Frequent Visitor

= Sql.Database (Server, Database, [Query= - Can I access 2 different Database name in a sub query

Hi everyone,
My problem is I have SQL subquery imported into Power BI to load data and also created a Database parameter so users can easily change the data sources whenever they want to change the Server name and database name.

In the Power Query, I see that "Sql.Database (Server, Database, [Query=" can not add more database which I have used in the sub-query! I can not find a way to config this. Does anyone have way to fix this parameter or the Power Query!

Thanks in Advance

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

You cannot dynamically change the server name.  You can run native queries that swap out the database name if the database is on the same server and you have access to both databases.

 

It is possible to change the server name via parameters in the service, or as part of deployment pipelines.

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

You cannot dynamically change the server name.  You can run native queries that swap out the database name if the database is on the same server and you have access to both databases.

 

It is possible to change the server name via parameters in the service, or as part of deployment pipelines.

Thanks! I'll try this way to set up for my report

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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