DEV Community

Kenichiro Nakamura
Kenichiro Nakamura

Posted on

Export pbix file from Power BI service via PowerShell

Power BI let's you download pbix from UI but you can also export it via API.

Download a report from the Power BI service to Power BI Desktop

Power BI Rest API: Reports - Export Report

Power BI team also released PowerShell module for PowerBI. So I explain how you can download pbix file via PowerShell.

Check the Report Id

Open a report on Power BI service and confirm the report id.
Alt Text


Open PowerShell as Administrator and install PowerBI module.

Install-Module -Name MicrosoftPowerBIMgmt

Then login to Power BI service.


Finally download pbix file.

  • Replace ReportId
  • Replace OutFile
$date = (Get-Date).ToString("yyyyMMdd")
$ReportId = "960e6b3d-b1ce-49fb-8e87-201d6e02f1e0"
$OutFile = "C:\Users\kenakamu\Desktop\test$date.pbix"

Invoke-PowerBIRestMethod -Method GET `
-Url${ReportId}/Export `
-ContentType "application/zip" -OutFile $OutFile

It fails if the file already exists, so I use date to make unique name.

Top comments (1)

cloudstakes profile image
CloudStakes Technology

Thank you for sharing this insightful article on the Power BI service via PowerShell.