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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Krishanu
Helper I
Helper I

How to run a MDX query for all datasets available in workspace

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.

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

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

 

View solution in original post

5 REPLIES 5
lbendlin
Super User
Super User

Assuming you can use the new-ish AAD based Power BI REST API custom connector you can do all this now in Power Query.

 

GitHub - migueesc123/PowerBIRESTAPI: A Microsoft Power BI Data Connector or Power Query Connector fo...

 

- collect all workspaces you have access to

- collect all datasets in these workspaces

- run MDX query against the datasets  (via the Analysis Services connector)

Yanant1020
Advocate I
Advocate I

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.

v-luwang-msft
Community Support
Community Support

Hi @Krishanu ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution to help others find it.
 
Best Regards
Lucien
 
v-luwang-msft
Community Support
Community Support

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

 

lbendlin
Super User
Super User

You create linked server entities for all your datasets and then run a UNION ALL query.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors