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
Anonymous
Not applicable

How to copy dataset using PowerShell Script

Hi Team,

 

We are stuck in the below scenario, need to copy Report with Dataset from One workspace to Another.

 

We have tried below method but it works only if the Dataset already exists in Destination Workspace

 

1) Copy-PowerBIReport 

Copy-PowerBIReport -Name "Report_Copy_5" -Id $source_report_id -WorkspaceId $source_WorkspaceId -TargetWorkspaceId $target_WorkspaceId -TargetDatasetId $targetDatasetId

2) Export & Import option in Power BI API

  1. Export report in Group
    1. groupId -> Workspace Id
    2. reportId -> Report Id
  2. Import-Get Import in Group
    1. groupId -> Workspace Id
    2. importId -> This Import Id is not clear from where we get

Note: First Export report is not working as don't know how to store the PBIX output, second Import option won't work without importId which don't know from where to pass.

 

3) Clone report In Group

  1. groupId - > Workspace Id
  2. reportId - > Report Id
  3. Request Body
    1. targetModelId-> Target dataset id which assumes like dataset id available in Destination Workspace
    2. targetWorkspaceId -> Target Workspace id

Note: this clone report clone the report every time on the same Workspace

 

Requesting you to provide proper guidance on how to accomplish the task, please share the PowerShell code.

 

Thanks in advance,

Santosh Sawant 

0 REPLIES 0

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.