Connect to Power BI using TM1 Rest api

Post Reply
kavitha2002
Community Contributor
Posts: 180
Joined: Sat May 05, 2018 11:48 am
OLAP Product: tm1
Version: 10.3.10100.8
Excel Version: 14

Connect to Power BI using TM1 Rest api

Post by kavitha2002 »

Hello Everyone,

In Power BI, I have tried the with Rest api MDx query.

In GetData -> web-> in Advancced option, gave RestapiUrl to fetch the Dimension Element. It Worked well and pull the elemnts from TM1 with the 'GET' Request.

Now am trying with MDX POST request to fetch the cube data. AS I am new to power BI, I just want to know how the cube data looks in PowerBI.
But in fiddler it shows below error, contentType not supported. In ARC/POSTMan same is working fine.

My try: I gave contentType as application/json also. But same error.
fiddler.png
fiddler.png (34.89 KiB) Viewed 4098 times
Kindy provide your ideas/suggestions. Thanks.
David Usherwood
Site Admin
Posts: 1457
Joined: Wed May 28, 2008 9:09 am

Re: Connect to Power BI using TM1 Rest api

Post by David Usherwood »

In your earlier thread https://www.tm1forum.com/viewtopic.php?f=3&t=15092 I and others said you should use TM1PY, since PowerBI can execute Python. IMO that is the best way forward unless you pony up for one of the many middleware products which do this job rather well.
kavitha2002
Community Contributor
Posts: 180
Joined: Sat May 05, 2018 11:48 am
OLAP Product: tm1
Version: 10.3.10100.8
Excel Version: 14

Re: Connect to Power BI using TM1 Rest api

Post by kavitha2002 »

Yes true, I agree. But I am trying with TM1 Rest api with Web Connector. Just as a POC.
ascheevel
Community Contributor
Posts: 288
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: PA 2.0.9.1
Excel Version: 365
Location: Minneapolis, USA

Re: Connect to Power BI using TM1 Rest api

Post by ascheevel »

Do you get the same error if you just pass "application/json" as the content type header instead of "application/json; charset=utf-8"?
kavitha2002
Community Contributor
Posts: 180
Joined: Sat May 05, 2018 11:48 am
OLAP Product: tm1
Version: 10.3.10100.8
Excel Version: 14

Re: Connect to Power BI using TM1 Rest api

Post by kavitha2002 »

I have tried "application/json" as well, but end up with the same error.
kavitha2002
Community Contributor
Posts: 180
Joined: Sat May 05, 2018 11:48 am
OLAP Product: tm1
Version: 10.3.10100.8
Excel Version: 14

Re: Connect to Power BI using TM1 Rest api

Post by kavitha2002 »

I have changed the Power BI syntax for the MDX query. Now query working well.

For the future reference, I am leaving the working query below.

let
url = "http://localhost:8000/api/v1/ExecuteMDX ... nal,Value)",
body = "{
""MDX"": ""SELECT {[}zPBI_Account].Members} on 0, {[}zPBI_Country].Members} on 1 FROM [zPBI_SalesCube] WHERE ([}zPBI_Model].[Model1], [}zPBI_Month].[J01])""
}",

Source = Json.Document(Web.Contents(url, [Headers=[#"Authorization"="Basic fasff", #"Content-Type"="application/json"]

])),
#"Source"
in
Post Reply