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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
edyck
Regular Visitor

Parameterize Semantic Model Data Source URL

Hi all,

 

I've got a Power BI Pipeline configured so that I can change the connection string of some SQL datasources to point to the correct environment, which works great.

 

Now I have a couple of reports that are connected to a published semantic model, and I want to change which workspace the reports look for based on the environment in the Power BI Pipeline, allowing me to automatically switch data sources when running through the pipeline.

 

From what I can see, there's no way in Power BI Desktop to parameterize the URL of the semantic model datasource, so I'm not sure how I could go about acheiving this. 

 

Any ideas or workarounds would be great!

1 ACCEPTED SOLUTION
edyck
Regular Visitor

It looks like there's no way to parameterize a Power BI semantic model URL for a report. What I ended up doing is resaving the pbix files as pbip projects, and then wrote a node script to dynamically change the workspace that the semantic model points to by editing `definition.pbir`. Unfortunately there is no public API for publishing Power BI projects, so I still have to manually open Power BI Desktop to publish them to the correct workspace.

View solution in original post

3 REPLIES 3
edyck
Regular Visitor

It looks like there's no way to parameterize a Power BI semantic model URL for a report. What I ended up doing is resaving the pbix files as pbip projects, and then wrote a node script to dynamically change the workspace that the semantic model points to by editing `definition.pbir`. Unfortunately there is no public API for publishing Power BI projects, so I still have to manually open Power BI Desktop to publish them to the correct workspace.

lbendlin
Super User
Super User

Looking at the data returned by that API call the datasource type is `Extension`, and it returns the details of the underlying connection, which is not what I want. What I'd like is to get back the URL of the Power BI semantic model and change that with the datasource update request, but it looks like this might not be something that's possible.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.