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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

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.