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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

PowerBINotAuthorizedException when trying to use ExecuteQueries endpoint

Hello! I am trying to use the ExecuteQueries endpoint of the PowerBI API in order to execute some DAX, but for this specific dataset and workspace combination, I am getting a 401 PowerBINotAuthorizedException.

 

I have added the service principal to the workspace and other endpoints work without issue, such as getting the refresh history.

7 REPLIES 7
Anonymous
Not applicable

I managed to find why this does not work. It is because the ExecuteQueries API endpoints does not work on datasets using RLS.

To be clear, that is only a limitation for the Service Principal - for quite obvious reasons.

 

Limitations

lbendlin
Super User
Super User

I am trying to use the ExecuteQueries endpoint of the PowerBI API" 

From where?  Have you registered an application and have you applied for the required permissions and scope?

 

Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Docs

Anonymous
Not applicable

It is executed via Python code, but that is not the issue. The app is properly registered and the service principal is added to the workspace. ExecuteQueries works in other workspaces and in this specific workspace, other  endpoints work just fine, besides ExecuteQueries.

V2 workspace?

Anonymous
Not applicable

Yes, it is a v2 workspace.

Since you have a Pro license you can consider raising a Pro ticket at https://powerbi.microsoft.com/en-us/support/pro/

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors