Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
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.
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.
" 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
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?
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/