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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Get dataset/report content via PowerShell

Scenario/goal: Get content (a tile value and a table) from a PowerBI report via PowerShell.

 

Is it possible to query for a report or dataset`s content via the API, specifically using either the Invoke-PowerBIRestMethod or the generic Invoke-RestMethod in PowerShell?

 

My initial testing using the MicrosoftPowerBIMgmt PowerShell module:

 

Connect-PowerBIServiceAccount -Tenant $tenantId -Credential $AppCredential -ServicePrincipal

 

$Workspace = Get-PowerBIWorkspace -Name 'Test'

 

$Report = Get-PowerBIReport -Name 'Test Data Report' -Workspace $Workspace

 

$Url = "https://api.powerbi.com/v1.0/myorg/reports/$($Report.Id.Guid)/pages"

 

Invoke-PowerBIRestMethod -Url $Url -Method Get

 

 

However, this only returns information about the reports pages – not the actual content/data.

 

Next, I tried the Get-PowerBITable cmdlet, which according to the documentation Retrieves a list of Power BI tables in the dataset that match the specified search criteria.

 

However, that was also not very successful:

Get-PowerBITable -DatasetId $Dataset.Id -WorkspaceId $Workspace.Id

Get-PowerBITable : Operation returned an invalid status code 'NotFound'

 

Both $DataSet and $Workspace is valid objects.

 

Looking at the dataset in the portal, there is a connection string looking like this:

powerbi://api.powerbi.com/v1.0/myorg/Test;initial catalog=Test Data

 

Maybe this can also be consumed somehow via PowerShell?

 

Any pointers in the right direction to get the actual data from a dataset or report using PowerShell would be highly appreciated.

2 REPLIES 2
JirkaZ
Solution Specialist
Solution Specialist

@Anonymous the APIs nor PS cmdlets are not there to extract data from Power BI. In your case I'd utilize reports subscriptions.

Anonymous
Not applicable

We eventually found the correct approach to achieve the goal in the mentioned scenario.

 

I wrote an article about the experience and how we solved it here.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.