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

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!