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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
TePe
Helper IV
Helper IV

M function to read from api.powerbi.com

I'd like to create a M function which reads from api.powerbi.com. Any idea how to authenticate with this data source? I had no luck with basic (didn't work) and Organizational (not supported). 

4 REPLIES 4
Anonymous
Not applicable

Hi @TePe ,

Which information you need to read from api.powerbi.com? Could you please provide more detail? Thank you.

Best Regards

Rena

Hi,

 

I need the list of workspaces with their users... So I wanted to use this API: 

 

https://api.powerbi.com/v1.0/myorg/admin/groups?$expand=users&$top=100

 

I tried it via M code and the Web data source, but how to authenticate?

 

Thanks,

 

 

Thomas

Anonymous
Not applicable

Hi @TePe ,

How did you connect to that API? And whether you get any error when connected? If yes, could you please provide the related screen shot?

In addition, please check if the following blogs can help you.

how to connect my web api wtih Power BI Reports?

Why is it so complex to connect to an API with Power BI or Power Query? The OAuth explained

API Strategies with Power BI

ACCESS TO THE RESOURCE IS FORBIDDEN ON POWER BI DESKTOP

Best Regards

Rena

Hi,

 

I'm trying two different way...

 

One is simply using the web source and using something like https://api.powerbi.com/v1.0/myorg/groups as a source. 

The alternative is that I use a M script like this:

 

(MyDomain as text) =>

let

Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/" & MyDomain & "/admin/groups?$expand=users&$top=100")),
value = Source[value],
fnGetWorkspaceUsers = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in fnGetWorkspaceUsers

 

At the end it's boiling down to the question how to authenticate. "Organizational Account" gives me this message:

Annotation 2020-04-29 103927.png

Basic Authentcation returns:

Annotation 2020-04-29 103926.png

 

If it's true about what I found out that the only chance is to use a customer connector for that, this would be really bad because I don't have access to AAD in the organization and deploying a custom connector would be a hell to go through security reviews. I just want to get something I can see on the portal in Power BI! Nothing fancy! Funny enough it works with the Graph API, so I can find out AAD users and groups... 

 

Thanks,

 

 

Thomas

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors