Forum Discussion
weiyu_chen
4 years agoFrequent Visitor
What is the escape char for rest api execute queries in postman
POST Body: { "queries": [ {"query": "EVALUATE COUNTAX(FILTER('Activity',[Activity Status]=\"Completed\"), [Priority])" } ], "serializerSettings": { "includeNulls": true } } Got this err...
- Anonymous4 years ago
Hi weiyu_chen ,
I checked some of the relevant restrictions and it seems that none of them are touched on your side...
- Only 1 DAX query can be executed per REST API request.
- Each DAX query can have only 1 result set.
- Result sets are capped at 100k rows.
- Supported data types: string, numeric, boolean, blank, datetime and variant. Binary is not supported.
- Azure AS and SSAS do not support this DAX REST API.
Is it possible that the error is reported because this DAX Query returned a single value, but the required return result here is a table? Change the DAX Query to the following form and see if it works:
{ "query": "EVALUATE SUMMARIZE ( 'Activity', \"countofpriority\", COUNTAX ( FILTER ( 'Activity', [Activity Status] = \"Completed\" ), [Priority] ) )" }Best Regards
lbendlin
Super User
4 years agoYou can try
"query": "EVALUATE COUNTAX(FILTER('Activity',[Activity Status]=""Completed""), [Priority])"
weiyu_chen
4 years agoFrequent Visitor
Also tried:
"query": "EVALUATE COUNTAX(FILTER('Activity',[Activity Status]='"'Completed'"'), [Priority])"
get the error:
{
"error": {
"code": "BadRequest",
"message": "Bad Request",
"details": [
{
"message": "After parsing a value an unexpected character was encountered: '. Path 'queries[0].query', line 3, position 70.",
"target": "request.queries[0].query"
},
{
"message": "'request' is a required parameter",
"target": "request"
}
]
}
}
Thanks!
Weiyu
- lbendlin4 years ago
Super User
Can you confirm that your original query runs in DAX Studio?
- weiyu_chen4 years agoFrequent Visitor
lbendlin I have run the following query (measurement) in Power BI desktop without any issue:
Subcategory Cound = COUNTAX(FILTER(ProductSubcategory,[ProductSubcategory] = "Fans"),[ProductSubcategoryKey])
Thanks!