Forum Discussion
New API Endpoint with DAX Queries
- 5 years ago
I finally got this partially worked out with the help of one of the very helpful Power BI engineers. For some reason datasets in My Workspace don't seem to be getting proper build permissions, so I decided to switch to just testing datasets in my v2 workspaces.
I initally thought that I had to use the format https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId} because that is what I'm accustomed to doing. This will probably change as this gets closer to GA, but for now you actually just remove the parts about the group and reference the dataset directly. For example: https://api.powerbi.com/v1.0/myorg/datasets/f388a618-2c93-41c5-8528-44c0c1129d70/executeQueries
Once I made that change, I was able to return data from a Powershell script and Postman. Still not sure about the permssions in My Workspace, but I'll likely never use that anway.
Hi rjhale
Code format looks like as below.
{ “queries”: [{“query”:”<Your DAX Query>“}], “serializerSettings”:{“incudeNulls”: true}}
Please add the permissions for read and write in API permission in Azure Portal and see if the script then works.
Please check whether you have enable the permission in Admin portal in Power BI Service.
Please check whether you have Build permission to this dataset and check whether this workspace is V2 instead of V1.
Current limitations in a nutshell:
- 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.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply. I'm using the PowerShell cmdlets, and the documentation states "The Power BI Management cmdlets have the required app permissions to use the DAX REST API". I don't think I should need adjust any App permissions in Azure because of this.
We have verified that the Allow XMLA Endpoints and Analyze in Excel setting is enabled for the entire organization. Also, the account I'm using is the owner of the dataset, so it definitely has build permissions. I've also tried publishing the dataset to "My Workspace" and a v2 workspace. It doesn't seem to matter which workspace it's published to. I get the same error regardless.
Any other ideas or suggestions?