cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

accessing power bi dataset using MDX query using windows is working but the same not working using python Linux server.

KVNARK
Honored Contributor II

trying to access the SSAS POIWER BI dataset using MDX query from python LInux server. We are hitting roadblock. The existing setup works as expected in windows system due to adodb.dll but unable to connect in Linux. Any help would be much appreciated.

We were using adodbapi in python to connect to powerbi

in local during development it was working as the windows system had the driver and it was running perfectly fine.

while moving to Test environment, the databricks cluster is in Linux and it is not compatible and looking for windows driver

We were using adodbapi, that required pywin32. pywin32 is windows specific so we require an alterantive way to access powerbi dataset and run MDX on top of it 

1 REPLY 1

Anonymous
Not applicable

@KVNARK .โ€‹ :

One potential solution would be to use an open-source MDX library for Python that can connect to SSAS, such as OLAP-XMLA for Python. This library can be used to execute MDX queries against a SSAS server, including Power BI datasets.

Here's an example code snippet to get you started:

from olapxmla.xmla import XMLAConnection
conn = XMLAConnection('http://<server_name>/powerbi/msmdpump.dll')
catalog = conn.Catalogs['<catalog_name>']
cube = catalog.Cubes['<cube_name>']
result = cube.execute("SELECT ... FROM ...")

Note that you will need to replace <server_name>, <catalog_name>, <cube_name>, and the MDX query with the appropriate values for your Power BI dataset.

Another option could be to use the Power BI API to extract data from the dataset, rather than connecting directly to the SSAS

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.