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
GOT2021
Frequent Visitor

Change data source in Power BI service

Hello, I'm new to Power Bi service, so I'm having trouble doing some things (maybe not possible at the moment).

 

I have several Postgresql data sources, I have access to one (the dev one) locally and the other not (I use a data gateway for prod one).

 

What I'd like to do is, once my dashboards have been developed on dev data, publish them in the project and then in the prod project, but using the prod data source in the prod project.

 

The two data sources have the same table names with the same columns.

I'd simply like to be able to change the data source in Power BI service.

 

GOT2021_0-1717755893541.png

 

Thanks

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Yes, Parameters is the right approach.  Did you use these parameters in your original connector?

View solution in original post

abpgupta
Continued Contributor
Continued Contributor

In Power Query, you can define Parameter and input all databases name as input. All other queries should be changed to use this parameter to refer for Data source name/connection strings.  Once published to Service, it will be available to set on Semantic Model's settings. 

View solution in original post

7 REPLIES 7
GOT2021
Frequent Visitor

Yes @lbendlin @abpgupta , I finally managed to solve the problem


1. I couldn't edit the parameter fields on the PowerBI Service side to put the prod url, so I had to do this : change Type Parameter to "Text" in Power Query

GOT2021_0-1717770880668.png

 


2. Once published, I still had the data from the dev database even though I'd modified the source, but I had to do this trick : reload the semantic

GOT2021_1-1717770991442.png

 

Everything's working fine now, but you may have some suggestions for improvement.

abpgupta
Continued Contributor
Continued Contributor

For string inputs, always use Text as type of data and avoid using "any". You can also create list of values as table and use as input in parameter to have control on string values.

I've seen this option in Power BI Desktop and I've added the two urls, but Power BI Service doesn't suggest the selection. I still have to enter the url and database name.

That's correct. The Power BI service doesn't care about choice fields. You have to provide the values.

It's perfect, thank you both for your feedback @lbendlin @abpgupta 

abpgupta
Continued Contributor
Continued Contributor

In Power Query, you can define Parameter and input all databases name as input. All other queries should be changed to use this parameter to refer for Data source name/connection strings.  Once published to Service, it will be available to set on Semantic Model's settings. 

lbendlin
Super User
Super User

Yes, Parameters is the right approach.  Did you use these parameters in your original connector?

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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