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
bi_small_potato
Frequent Visitor

Python Rest API Python 404 ExecuteQueries

I am using power bi rest api by python to get the table data using service principal. I had enable all the required settings under the tenant settings and able to get groups report through the api. However when i try to executeQueries it keep show 404 error : No HTTP resource was found that matches the request URI

url = 'https://api.powerbi.com/v1.0/myorg/groups/{groupID}/datasets/{datasetID}/executeQueries'

query_payload = '''{
                        "queries": [
                            {
                                "query": "EVALUATE VALUES(Mytable)"  
                            }
                        ]
                        }'''
        response = requests.get(url, json=query_payload, headers=header )
I had enable Semantic Model Execute Queries REST API under Integration Settings and also all the service principal related settings, for the serviceprincipal also enable dataset.ReadWrite.all permission , what else i can do to solve the problem ? 
1 ACCEPTED SOLUTION

@bi_small_potato 

That sounds odd. One quick question, your original post suggests that you ran requests.get function. 
Should not it be requests.post method?

Considering this the api documentation itself says its a post call

https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries

Screenshot 2025-03-10 at 9.59.16 AM.png

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

View solution in original post

6 REPLIES 6
bi_small_potato
Frequent Visitor

yes , i had actually replace all with my groupid and datasetid and grant the permission as admin for the workspace, i am able to get the result 'https://api.powerbi.com/v1.0/myorg/groups/{groupID}/datasets/when i search for dataset , but it dont work for executequeries , the dax queries is work in power bi as it is just simple evaluate values() .

Is this option enabled in your tenant?

Screenshot 2025-03-10 at 9.40.42 AM.png

If you dont have permissions to reach tenant admin portal then you can run the same api with your user id and its token. If that works then its an issue this setting. Also have you verified the other limitations documented here  

https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries

Screenshot 2025-03-10 at 9.43.24 AM.png

Is there any RLS configured for your dataset? Please re validate all the limitations

 

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

yes , i had enable these settings , and the dataset had no RLS .

@bi_small_potato 

That sounds odd. One quick question, your original post suggests that you ran requests.get function. 
Should not it be requests.post method?

Considering this the api documentation itself says its a post call

https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries

Screenshot 2025-03-10 at 9.59.16 AM.png

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

thanks , you are right. I had use wrong function , i need to use request.post instead of request.get , 😂

tharunkumarRTK
Super User
Super User

@bi_small_potato 

Error message indicates, Resource not found

1. Have you added services principal to the worksapce as a Contributor or greater role?

2. Have you passed the workspace id (group id) and dataset ID process in the API endpoint ?

3. Please test the dax query that you would like to run in DAX query view or DAX studio 

 

I am assuming you enabled, necessary admin settings at the tenant level required to executive Power BI APIs with service principal and you also enabled Executive DAX queries option. 

 

The URL that you shared seems to be the API endpoint temaplate, while running the API you need to replace the dataset id with your semantic model ID and group id with your workspace ID, I am assuming you have done that

 

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

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.