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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.