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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

how to fetch all Datasources for all Datasets

Hello, i am trying with the PowerShell apis but to no avail. i am looking for a way to retreive all the datasets and their underlying data sources for the whole organization. so i do not want to have to enter the DatasetID ot PowerBIDatasouce api.

 

anyhelp would be well appreciated

 

 

6 REPLIES 6
Anonymous
Not applicable

Any update on that ? 

Anonymous
Not applicable

Not sure what you mean by "whole organisation" but my guess is all workspaces that your user has access to.

Get all datasets in your organization: https://docs.microsoft.com/en-us/powershell/module/microsoftpowerbimgmt.data/get-powerbidataset?view... (Example 2)

Loop through all datasets and get all datasources in each dataset: https://docs.microsoft.com/en-us/powershell/module/microsoftpowerbimgmt.data/get-powerbidatasource?v... (Example 2 if you only want datasources in your organization in the specified dataset)

 

You can call the REST api using Powershell , if you want to do that my suggestion would be to get all workspaces which you have access to:

https://docs.microsoft.com/en-us/rest/api/power-bi/groups/getgroups

Loop through all workspaces and for each workspace get all datasets :

https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasetsingroup

And then for each dataset get all datasources : 

https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/getdatasourcesingroup

 

 

Anonymous
Not applicable

Hi thanks for your reply, so when i say 'whole organization' i actually mean the organization.

so it looks like i need to write some powershell script to loop through the results from one api, and add as a parameter to another api.

is that what you mean ?

ta

 

Anonymous
Not applicable

Okay, then yes I believe that is how you'll have to do it

Anonymous
Not applicable

mmmmm, fair enough.

i was hoping to run the individual apis, each into a file, and perform some joining in Power BI.

but due to having to have a DatasetID as an input parameter, i cannot run it wide open.

it's a shame as other apis, can be run wide open, with just the 'organization' -scope value

 

😞

 

Anonymous
Not applicable

This is just a guess from my side, I don't know the Power BI Powershell API, powershell in general, well enough to tell you this is the way to go

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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