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
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

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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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