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
DebbieE
Community Champion
Community Champion

Datasets - execute queries REST API

we are trying to use the following

 

https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries?source=docs

 

where you can use a REST API and add a query like this

 

{ "queries": [ { "query": "EVALUATE VALUES(MyTable[Column])" } ], "serializerSettings": { "includeNulls": true } }

 

I am a little confused though. Queries to me mean the tables in Power BI. So my question is. Can I use this to run DAX Measures? To me these a Measures created in DAX Rather than queries. It doesnt mention this in the documentation so I just wanted to get it straight in my head before we continue

1 ACCEPTED SOLUTION
Gentiana
Microsoft Employee
Microsoft Employee

Measures are calculations computed at the granularity specified in the DAX query they are a part of. They are defined at the model level but evaluated only at DAX execution time.
This API allows you to control what goes into your DAX query (which columns or measures). So if you have already defined a measure in your model (through PowerBI Desktop) and it is saved and published, then you can invoke it in your DAX query as follows:

EVALUATE ROW("MyMeasure", TableName[MyMeasure]) - this will evaluate it with no granularity specified, so effectively means for the whole dataset
or
EVALUATE(SUMMARIZECOLUMNS(TableName1[Column1], TableName2[Column2], "MyMeasure", TableName[MyMeasure]) - this will evaluat it at the granularity of Column1 and Column2 (for example for each Continent-Year combination)

A DAX query allows you to perform an evaluation of something from the data model. It's result is a table of data. What goes into the DAX query is up to the caller of the API. You can refer to public DAX documentation on what functions are available.

View solution in original post

2 REPLIES 2
Gentiana
Microsoft Employee
Microsoft Employee

Measures are calculations computed at the granularity specified in the DAX query they are a part of. They are defined at the model level but evaluated only at DAX execution time.
This API allows you to control what goes into your DAX query (which columns or measures). So if you have already defined a measure in your model (through PowerBI Desktop) and it is saved and published, then you can invoke it in your DAX query as follows:

EVALUATE ROW("MyMeasure", TableName[MyMeasure]) - this will evaluate it with no granularity specified, so effectively means for the whole dataset
or
EVALUATE(SUMMARIZECOLUMNS(TableName1[Column1], TableName2[Column2], "MyMeasure", TableName[MyMeasure]) - this will evaluat it at the granularity of Column1 and Column2 (for example for each Continent-Year combination)

A DAX query allows you to perform an evaluation of something from the data model. It's result is a table of data. What goes into the DAX query is up to the caller of the API. You can refer to public DAX documentation on what functions are available.

v-luwang-msft
Community Support
Community Support

Hi @DebbieE ,

Refer the the following link,and check if it could help you!

https://community.powerbi.com/t5/Developer/DAX-Measure-with-REST-API-dataset/m-p/445389 

 

Best Regards

Lucien

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.