Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mithunt
New Contributor II

Dax Studio - Python Connection

Hello All,

 

There is a plan to move data source from one database to another for which it would be essential for us to understand the dashboards within a workspace. 

 

I have explored few options in Dax Studio which has capability to return Measures, Columns, Catalogs (Dashboards) and other details of a specific workspace. 

However if I need to get a detailed inforamtion across all the Power BI Dashboards in a workspace, the commands below would not allow me to.

 

SELECT [CATALOG_NAME] FROM $SYSTEM.DBSCHEMA_CATALOGS
SELECT [CATALOG_NAME] FROM $SYSTEM.DBSCHEMA_CATALOGS,
SELECT [ID],[Name] FROM $SYSTEM.TMSCHEMA_TABLES WHERE NOT [IsHidden]
SELECT * FROM $SYSTEM.TMSCHEMA_COLUMNS WHERE NOT [IsHidden]
SELECT [ID],[TableID],[Name],[QueryDefinition] FROM $SYSTEM.TMSCHEMA_PARTITIONS
SELECT [ID],[TableID],[Name],[Expression] FROM $SYSTEM.TMSCHEMA_MEASURES WHERE NOT [IsHidden]
SELECT * FROM $SYSTEM.TMSCHEMA_RELATIONSHIPS

 

Requesting your guidance if there is a way I can loop through all the commands above and get the data into Excel format or into SQL or connect to Power BI directly so that I can analyze it further. 

 

Regards

Mithun T

5 REPLIES 5
tayloramy
Contributor

Hi @mithunt,

 

Youโ€™re on the right track using the $SYSTEM DMVs. The trick is to (1) enumerate every dataset (catalog) in the workspace, then (2) loop your DMV queries against each catalog, and (3) export to CSV/Excel or land it in SQL for analysis.


โ€“ If you just need files fast: Use DAX Studioโ€™s command-line to loop a workspace and export DMV results to CSV/XLSX or straight to SQL. Itโ€™s simple and robust. Docs, output modes.
โ€“ If you want code & full control: Use Python + XMLA (e.g., pyadomd/python-tabular) to connect to each dataset and run your DMV statements, then write to Excel/SQL.
โ€“ If you want full workspace inventory (reports, dashboards, lineages, permissions): Use the Power BI Admin Scanner APIs to pull metadata for all artifacts in one shot, then optionally enrich with DMV details via XMLA. Admin โ€“ WorkspaceInfo, Scanner quickstart.

Note: Querying XMLA endpoints (DMVs/TOM) requires the workspace to run on Premium/Fabric capacity (or PPU). XMLA endpoint overview, Premium features.


If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

v-menakakota
Honored Contributor II

Hi  @mithunt  ,

I would also take a moment to thank @tayloramy โ€ฏ , for actively participating in the community forum and for the solutions youโ€™ve been sharing in the community forum. Your contributions make a real difference. 
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. Weโ€™re always here to support you.

 

Best Regards, 
Community Support Team

mithunt
New Contributor II

Hello @tayloramy 

 

Thank you for the update, 

 

Ill give it a try based on your suggestions, however let me know if you already have tried and the method you used worked for you in pulling all the required data in a workspace. 

 

v-menakakota
Honored Contributor II

Hi @mithunt ,

Thank you for the update, can you please reply back once after you try it.

Best Regards, 
Community Support Team.

v-menakakota
Honored Contributor II

Hi @mithunt ,

Can you please confirm whether the issue got sorted or not. Did you get a chance to try the workaround.

Best Regards, 
Community Support Team.

Helpful resources

Announcements
Users online (5,084)