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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Deploy dataset to multiple workspaces with script

Hi,

 

I have a master dataset that I would like to copy, deploy to multiple workspaces and change a dataset paramenter all with a script. From what I can tell, I should be able to do this with the XMLA endpoint, Is this something I can do with Tabluar editors advanced scripting?

 

I haven't found any good examples of this or alternative ways to do it. Any advice would be greatly appreciated 🙂

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

You can use PowerShell scripts to deploy a Power BI dataset to multiple workspaces. Here is an example script that imports a dataset to multiple workspaces:

PowerShell script that automatically uploads PowerBI report to list of Workspaces - Stack Overflow

Import-Module MicrosoftPowerBIMgmt

$oldReportName = "Fancy Report"
$pbixFilePath = "C:\Power BI\Fancy Report.pbix"

$username = "[email protected]"
$password = "P@ssw0rd" | ConvertTo-SecureString -asPlainText -Force

$credential = New-Object System.Management.Automation.PSCredential($username, $password)

Connect-PowerBIServiceAccount -Credential $credential | Out-Null

# -All - Returns all results, not only top 100
$workspaces = Get-PowerBIWorkspace -All -Scope Organization -Include All

foreach($workspace in $workspaces) {

  $report = Get-PowerBIReport -WorkspaceId $workspace.Id -Scope Organization -Name $oldReportName

  if ($report) {
    Write-Host "Report $oldReportName found in workspace $($workspace.Name)..."
    New-PowerBIReport -Path $pbixFilePath -Workspace $workspace -ConflictAction CreateOrOverwrite
  }

}

Disconnect-PowerBIServiceAccoun

PowerShell script to publish Power BI reports into multiple tenants - Power of Business Intelligence...

Related Cmdlet official documentations:

Get-PowerBIWorkspace (MicrosoftPowerBIMgmt.Workspaces) | Microsoft Learn

New-PowerBIReport (MicrosoftPowerBIMgmt.Reports) | Microsoft Learn

Best Regards

Anonymous
Not applicable

Hi @Anonymous thank you for your response, when I try to push via the Rest api I get an error becasue my dataset it too big. This is way I wanted to use the XMLA endpoint. 

 

Is there a way to use the Rest API for a large dataset?

Anonymous
Not applicable

Hi @Anonymous ,

You can follow the steps below to get it:

  1. Make sure that the XMLA endpoint is enabled for read/write operations in the Power BI Admin portal.vyiruanmsft_0-1693896351463.png
  2. Use a tool like SQL Server Management Studio (SSMS), the open-source Tabular Editor, or script with Tabular Model Scripting Language (TMSL) to connect to the XMLA endpoint of the workspace that contains the dataset you want to deploy.
  3. Use the tool to create a backup of the dataset.
  4. Connect to the XMLA endpoint of each workspace you want to deploy the dataset to.
  5. Use the tool to restore the backup of the dataset to each workspace.vyiruanmsft_1-1693896639183.png

In addition, you can refer the following links to get it.

Dataset connectivity and management with the XMLA endpoint in Power BI - Power BI | Microsoft Learn

Backup and restore Power BI Premium datasets - Power BI | Microsoft Learn

Power BI — backup and restore datasets | by Michal Molka | Medium

Best Regards

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.