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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Error running Powershell Get-PowerBITable

Hello,

I've experienced an error while running the following command:


Get-PowerBITable -DatasetId [My Dataset ID Here] -WorkspaceId [My Workspace ID here] . Error is as follows:

Get-PowerBITable : Operation returned an invalid status code 'NotFound'
At C:\Powershell Tests\Test.ps1:6 char:1
+ Get-PowerBITable -DatasetId ..... -Wor ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...GetPowerBITable:GetPowerBITable) [Get-PowerBITable], HttpOperationException
+ FullyQualifiedErrorId : Operation returned an invalid status code 'NotFound',Microsoft.PowerBI.Commands.Data.GetPowerBITable

 

Please kindly assist.

 

Regards,

Joe

10 REPLIES 10
ElhamBa
New Member

I have a same error when I am running Get-PowerBITable -DatasetId  or Invoke-PowerBIRestMethod -Url 'datasets/{datasetId}/tables' -Method Get but I am able to run other admin command 

lattali__ahmed
Frequent Visitor

The command  Get-PowerBITable is actually calling the REST API to get list of tables

 

Unfortunatly this only possible for push datasets at the moment

 

Check this link

https://docs.microsoft.com/en-us/rest/api/power-bi/push-datasets/datasets-get-tables

Anonymous
Not applicable

This is answer!

MarianoCatalano
Advocate I
Advocate I

I am having the same problem, I am a Power BI Admin, when I execute the following command in powershell

Get-PowerBIDataset -Scope Organization | Get-PowerBITable

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

Anonymous
Not applicable

No, I was not able to find any solutions on that.

Jayendran
Solution Sage
Solution Sage

Hi @Anonymous 

 

As the error mentioned the Script couldn't able to find it the one which you are looking

 

Possible reason:

 

  • Either your datasetid/workspace id is wrong
  • The logged in user (from the powershell session) is not having permission to the workspace/dataset

 

~Jay 

Pls join my upcoming webinar

Anonymous
Not applicable

Hi Jayendran,

It is strange, because I am setup as the Power BI Service Admin of our tenant.

I am confident that my datasetid/workspace id are correct (I got it by reading from url or running  Get-PowerBIDataset -Scope Organization)

 

I am able to run the following and get data without issues: 

Get-PowerBIDataset -Scope Organization

Get-PowerBIWorkspace -All

 

By removing the workspace id, error is : Get-PowerBITable : Operation returned an invalid status code 'Forbidden'. 

 

Really need help from someone to understand what is happening.

 

Regards,

Joe

Hi @Anonymous ,

 

Ah now it's Forbidden error which means like you are not allowed. Can you try the same script in a new powershell session or window

Anonymous
Not applicable

Hi Jayendran,

 

Yes I did couple of times. But still have the same issue.

 

Regards,

Joe

Anonymous
Not applicable

Seeing the same behaviour here - did you ever find a solution?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.