Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
I have a premium workspace with multiple datasets. How can I run a simple MDX query (like SELECT * FROM $System.DISCOVER_M_EXPRESSIONS ) for all datasets available in that worksapce via SSMS (XMLA endpoint)?
The MDX runs for each dataset, now we have to run this for mutiple datasets and in multiple workspaces.
Any advise or help is really appreciated. Thanks.
Solved! Go to Solution.
Hi @Krishanu ,
The following article have a solution about how to run dax or mdx queries against Power Bi,you could have a look.
Can I run my own DAX or MDX queries against Power BI?
Wish it is helpful for you!
Best Regards
Lucien
Assuming you can use the new-ish AAD based Power BI REST API custom connector you can do all this now in Power Query.
- collect all workspaces you have access to
- collect all datasets in these workspaces
- run MDX query against the datasets (via the Analysis Services connector)
I have this exact same need and we have lots of datasets. As far as I can tell the linked blog post that is five years old is likely working with limitations that do not exist anymore. Is there a better solution to this issue you have found? I need to be able to query ALL our published datasets on a schedule to retrieve information about them.
Hi @Krishanu ,
Hi @Krishanu ,
The following article have a solution about how to run dax or mdx queries against Power Bi,you could have a look.
Can I run my own DAX or MDX queries against Power BI?
Wish it is helpful for you!
Best Regards
Lucien
You create linked server entities for all your datasets and then run a UNION ALL query.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.