Forum Discussion
PowerBI API - Execute Queries on Dataset - Problem with DAX Statement
- Anonymous3 years ago
Hi RubenSchilling ,
As far as I know, AVERAGE() should be an aggregation function which will return aggregated value instead of a table.
Datasets - Execute Queries Rest API will return data as a table.
So Power BI will return error.
You may refer to this offical blog to learn more details.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Good morning,
i am not able to execute any queries via the Execute query REST API, except when i ONLY use evaluate.
As you can see this one works without problem:
{
"queries": [
{
"query": "EVALUATE VALUES(Manufacturer)"
}
],
"serializerSettings": {
"includeNulls": true
}
}
RESULT:
{
"results": [
{
"tables": [
{
"rows": [
{
"Manufacturer[ManufacturerID]": 6,
"Manufacturer[Manufacturer]": "Leo",
"Manufacturer[MfgisVanArsdel]": "No"
But when i literally use any other query like this:
{
"queries": [
{
"query": "AVERAGE(Sentiment[Score])"
}
],
"serializerSettings": {
"includeNulls": true
}
}
The Result usually shows something like:
{
"error": {
"code": "DatasetExecuteQueriesError",
"pbi.error": {
"code": "DatasetExecuteQueriesError",
"parameters": {},
"details": [
{
"code": "DetailsMessage",
"detail": {
"type": 1,
"value": "Query (1, 1) The syntax for 'AVERAGE' is incorrect. (AVERAGE(Sentiment[Score]))."
}
},
{
"code": "AnalysisServicesErrorCode",
"detail": {
"type": 1,
"value": "3238920194"
}
}
]
}
}
}
I would appreciate any kind of help or hint in what i am doing wrong, or if certain statemeent s are just not supported within the API etc.
BR Ruben
RubenSchilling Whether it is REST API, Power BI Desktop, Service, SSAS, Azure, DAX can be only queried by external tools using EVALUATE, that's what initiates the command.