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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
barakb32
Advocate I
Advocate I

REST API Dataset Queries

Hello,

 

I would like to check if a certain filter is applied on every Power Query query that is used to build and refresh the datast.

Is there a way to programatically see thw query code for every query?

 

Thanks

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Run a DMV query against the dataset. 

 

 select * from $SYSTEM.TMSCHEMA_PARTITIONS

 

You can use DAX Studio or any other tool that can access the XMLA endpoint.

lbendlin_0-1638040206868.png

 

View solution in original post

5 REPLIES 5
lbendlin
Super User
Super User

Run a DMV query against the dataset. 

 

 select * from $SYSTEM.TMSCHEMA_PARTITIONS

 

You can use DAX Studio or any other tool that can access the XMLA endpoint.

lbendlin_0-1638040206868.png

 

Hi @lbendlin 
I am trying to write python code for executequeries REST API 
I am able to other REST API queries without any problem.

but Executequeries 
--https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/executeQueries

i don't have any clue where i can write the DAX query...and how can i write it.
I gone through the documentation https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries

but still not getting where i need to write the query and how to pass it 
https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/executeQueries 
here

if possible can you please let me know how can execute this in python. (any dax query is fine)

No idea why you would want to do this in Python.  But if you insist then you need to construct the body according to this example 

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

including all the character escapes etc.  It must be in this format , otherwise it will not work.

Thanks for replay @lbendlin 
yes i got it even in Powershell/ Python 
i just want to know once i build the body where in this line i need to pass https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/executeQueries  the body??

I appreciate if you give any suggestions on this 
thanks in advance

the body goes into the Content attribute. See example 2

 

Web.Contents - PowerQuery M | Microsoft Docs

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.