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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Post Patron
Post Patron

Add another or more pbix but connected to data source uploaded to power bi



From what I understand, the App-Owns-Data Starter Kit has a pbix template that uses the report to display in the different scopes that are created. My question is how can I change that pbix? Can I put several since in my case I have more than one report?

As it seems, take the following code to do it:




public PowerBiTenant OnboardNewTenant(PowerBiTenant tenant) {


      PowerBIClient pbiClient = this.GetPowerBiClient();


      // create new app workspace

      GroupCreationRequest request = new GroupCreationRequest(tenant.Name);

      Group workspace = pbiClient.Groups.CreateGroup(request);


      tenant.WorkspaceId = workspace.Id.ToString();

      tenant.WorkspaceUrl = "" + workspace.Id.ToString() + "/";


      // add user as new workspace admin to make demoing easier

      string adminUser = Configuration["DemoSettings:AdminUser"];

      if (!string.IsNullOrEmpty(adminUser)) {

        pbiClient.Groups.AddGroupUser(workspace.Id, new GroupUser {

          EmailAddress = adminUser,

          GroupUserAccessRight = "Admin"




      // upload sample PBIX file #1

      string pbixPath = this.Env.WebRootPath + @"/PBIX/SalesReportTemplate.pbix";

      string importName = "Sales";

      PublishPBIX(pbiClient, workspace.Id, pbixPath, importName);


      Dataset dataset = GetDataset(pbiClient, workspace.Id, importName);


      UpdateMashupParametersRequest req =

        new UpdateMashupParametersRequest(new List<UpdateMashupParameterDetails>() {

          new UpdateMashupParameterDetails { Name = "DatabaseServer", NewValue = tenant.DatabaseServer },

          new UpdateMashupParameterDetails { Name = "DatabaseName", NewValue = tenant.DatabaseName }



      pbiClient.Datasets.UpdateParametersInGroup(workspace.Id, dataset.Id, req);


      PatchSqlDatasourceCredentials(pbiClient, workspace.Id, dataset.Id, tenant.DatabaseUserName, tenant.DatabaseUserPassword);


      pbiClient.Datasets.RefreshDatasetInGroup(workspace.Id, dataset.Id);


      return tenant;




The issue is that in my pbix I access the data through a data source that I have in powerbi, if I simply change the pbix it gives an error because it tries to connect to a database that does not exist.

Do you know how I can proceed to change a pbix/add more to this code?


Post Patron
Post Patron

Is there no one who can help me?
I want to use another pbix but it doesn't connect to any sql database, it's just a pbix connected to a data set from another pbix and with more than one report.

Hi @apenaranda ,


According to your description, if you are connecting datasets in the service, you cannot merge pbix. The connection mode is Live connection.


Reports that share a dataset on the Power BI service don't support automated deployments using the Power BI REST API. 

Best Regards,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


So the only way I have is to use a pbix with the data?
I mean, not the one that comes as an example but another one of mine and with more than one report inside.
The thing is that when you create the tenant, you create it with all the reports there are... I don't know if it would be possible.
Thank you very much.

Helpful resources

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.