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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
_Ilocans
Frequent Visitor

Power BI Rest API & C#

Hello

 

I am working on a c# tool that connect to a power bi dataset on a premium capacity to and execute some Dax queries. I use the dataset connection string with an adomdconnection using the "interactive" authentication (web page where I must fill my email address and password). 

I would like to do the same with a dataset on a the shared capacity. In that case, the connection string is not supported.

I think the best way would be to use the rest api and the Dataset - Execute Queries.

I would like to be able to authenticate the same way(interactive mode with my credentials) to get the necessary token to execute my dax queries. Is it possible? All I found is using a client ID and client secret but I can't use this method for now. Or any other workaround to execute DAX?

 

thank you for your help

2 REPLIES 2
Anonymous
Not applicable

Hi  @_Ilocans ,

 

Based on my research in the official docs, if you are trying to run any DAX query against the Power BI dataset, you need to enable the XMLA endpoint for the third-party tool connectivity to it, if you haven't enabled any XMLA endpoint for for Power BI dataset hosted capacity, you can't achieve the connectivity, but the XMLA endpoint needs the Premium/PPU capacity hosted as the document mentioned:

Semantic model connectivity and management with the XMLA endpoint in Power BI - Power BI | Microsoft...

vyangliumsft_0-1702460876686.jpeg

So if you want to run any DAX query against the Power BI dataset, you need to at least have the PPU/Premium capacity hosted datasets.

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hello

 

thank you for your answer.

I would like to use this API Datasets - Execute Queries In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn

It does not require any ppu/preemium capacity.

 

I would like using C# to be able to authenticate with my user credential ( I mean interactive mode with my credentials) to get the necessary token to execute my dax queries. Is it possible in C# ? All I found is using a client ID and client secret but I can't use this method for now. Or any other workaround to execute DAX?

Per exemple, if I test the Try it button on the page, I can authenticate with my user credential and run dax queries witout providing any client id. I would like to do the same in c#.

 

Regards

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.