cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group