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
apenaranda
Post Partisan
Post Partisan

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

Hello,

 

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 = "https://app.powerbi.com/groups/" + 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?

Thanks.

3 REPLIES 3
apenaranda
Post Partisan
Post Partisan

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.

 

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-report-lifecycle-datasets#considerati... 


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

Hello,

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

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 community update carousel

Fabric Community Update - June 2025

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