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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
pennyhoho117
Helper IV
Helper IV

seeking help to retrieve Power BI Dataset data by Power API

i have created a workspace and granted admin right to the Azure app account.

and i have send API :  https://api.powerbi.com/v1.0/myorg/groups/89f9ce17-e8e3-433c-b419-6b2b6d87273c/datasets/8360b63e-a13...

 which reqest header:  data = {
"queries": [
{
"query": "EVALUATE VALUES(TestRedshiftRefresh)"
}
]
}

 

where TestRedshiftRefresh is the dataset name, but i received error: 

{'error': {'code': 'PowerBINotAuthorizedException', 'pbi.error': {'code': 'PowerBINotAuthorizedException', 'parameters': {}, 'details': [], 'exceptionCulprit': 1}}}

 

Can any people help me? Thanks

6 REPLIES 6
pennyhoho117
Helper IV
Helper IV

the https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{dataset_id}/executeQueries API keeps returning error 401:  {'error': {'code': 'PowerBINotAuthorizedException', 'pbi.error': {'code': 'PowerBINotAuthorizedException', 'parameters': {}, 'details': [], 'exceptionCulprit': 1}}}

but i already checked included tenor setting for API calling and  Allow service principals to use Power BI APIs 

Could you give me suggestions?

lbendlin
Super User
Super User

Careful using VALUES with tables!!!

 

EVALUATE TestRedshiftRefresh

 

is probably more appropriate.

 

Admin rights don't matter. the scope needs to include Read Dataset permissions.

i use  "query": "EVALUATE (TestRedshiftRefresh)" 

also return with same error,  and i included Read Dataset permissions already, any other suggestions?

Have you checked at jwt.io that the token has the required scope?

How to check if the return token by API : https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token has required scope?

Go to jwt.io and check if scp (scope) is set correctly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.