Forum Discussion
DAX Error: Unsupported Media Type
Hi all, I'm trying to execute the query by using the REST API. It showed the error that Unsupported Media Type when I run below code. Is there any correction should be? Thanks for help!
let
body=" { 'queries': [ { 'query': 'EVALUATE SELECTCOLUMNS ('1#+SM+Missing+Region', '1#+SM+Missing+Region'[SKU]) } ], 'serializerSettings': { 'includeNulls': true } }",
Source = Json.Document(
Web.Contents(
"https://api.powerbi.com/v1.0/myorg/datasets/4cd14ac0-b612-48aa-980d-136d46a3e15c/executeQueries",
[
Headers=[Authorization="Bearer "&Token()],
Content=Text.ToBinary(body)
]
)
)
in
Source
You know you can do the same much simpler via the SSAS connector, right?
let Source=AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/<workspace name", "<dataset name>", [Query="EVALUATE ...", Implementation="2.0"]) in Source
4 Replies
- lbendlin
Super User
You know you can do the same much simpler via the SSAS connector, right?
let Source=AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/<workspace name", "<dataset name>", [Query="EVALUATE ...", Implementation="2.0"]) in Source- nbufff
Helper I
YES. It works perfectly. Greatly Appreciate Your help!
- lbendlin
Super User
I added the sample code. Please try it out.