This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowThe Fabric community is now in read-only for platform upgrade. Learn more
Hi folks,
I am trying to run this script to export paginated report into an excel file using PowerShell but I am getting an error, Could anyone please help me?
Things which ran successfully using PowerShell : Logging into PBI Service , Retrieving Workspace and Report ID
$reportId = "7abc73b4-0bad-4edb-8f52-xxxxxxxxxxxx"
$groupId = "04a7c8b4-9c13-4838-b812- xxxxxxxxxxxx "
$endpoint = "https://api.powerbi.com/v1.0/myorg/reports/$reportId/ExportTo"
$endpoint = "https://api.powerbi.com/v1.0/myorg/groups/$groupId/reports/$reportId/ExportTo"
$body = @"
{
"format": “XLSX"
}
"@
$headers = Get-PowerBIAccessToken
$headers.Add("Content-type", "application/json")
$response = Invoke-RestMethod -Headers $headers -Uri $endpoint -Body $body -Method 'Post'
$response
Error:
Thanks in Advance!
Hi,
According to your detailed error message, it seems that you met the (400) bad request error, you can follow this document to troubleshoot your problem:
https://airbrake.io/blog/http-errors/400-bad-request
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
| User | Count |
|---|---|
| 15 | |
| 11 | |
| 9 | |
| 8 | |
| 6 |
| User | Count |
|---|---|
| 29 | |
| 23 | |
| 18 | |
| 15 | |
| 13 |