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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Trodo737
Frequent Visitor

Connection to different environment in PBI Desktop

In the system I'm working with, there are three environments(server) for SQL databases, Dev, Test and Prod and the same SQL tables and views in all environments. I've created some reports in PBI Desktop with connection to Dev.

There is no Analysis- or Reporting Services, just PBI Desktop and connection to SQL databases. In the reports I've created in Dev, if I want to connect to Test or Prod environment, the SQL views would be added to the list of views I have already from Dev in my report. How can I connect to other environments without adding SQL views?

1 ACCEPTED SOLUTION
Trodo737
Frequent Visitor

 

I resolved the issue by adding the data source in Data source setting.

File ->Options and setting -> Data source setting -> and there added other data sources to the list and it works to select other DB servers.

View solution in original post

3 REPLIES 3
Trodo737
Frequent Visitor

 

I resolved the issue by adding the data source in Data source setting.

File ->Options and setting -> Data source setting -> and there added other data sources to the list and it works to select other DB servers.

Thejeswar
Super User
Super User

Hi @Trodo737 ,

You can use parameters to connect to different environments in the same report. The Below are the steps you can take to connect using parameters

 

  1. Create Parameters:

    • Open Power BI Desktop and go to the Home tab.
    • Click on Manage Parameters and select New Parameter.
    • Name your parameter (e.g., “ServerName”) and set the type to Text.
    • Add the possible values for your parameter (e.g., different server names) and set the default value.
  2. Use Parameters in Queries:

    • Go to the Home tab and select Transform Data to open the Power Query Editor.
    • In the Power Query Editor, select the query you want to parameterize.
    • Click on the Advanced Editor and replace the static parts of your connection string with the parameters you created. For example:
      let
          Source = Sql.Database(ServerName, DatabaseName)
      in
          Source
  3. Apply Parameters:

    • After setting up your parameters, go back to the Home tab in Power BI Desktop.
    • Click on Transform Data > Data Source Settings.
    • Select the data source you want to parameterize and click on Change Source.
    • Replace the static values with the parameters you created.

You can try the above steps to setup connection using parameters.

 

You can then use the parameter in slicer and try changing the value and see if it works with new connection

 

Regards,

 

Thank you @Thejeswar . I'm using the new version of PBI Desktop and it seems that the new one doesn't have this option anymore(for creating parameters for datasources https://www.phdata.io/blog/how-to-parameterize-data-sources-power-bi/). I found 'New parameters' under 'Modeling' but there is only option for numeric and field. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors