Forum Discussion
Extract List Power BI DataSources/Connections and Reports they are attached to
- 8 months ago
Hi KarenL7,
Great to hear the REST API/M code approach is already working for you to list gateways, datasets, reports, and datasources across workspaces — that’s exactly how most admins solve the multiple connections issue.
For the lineage view across reports regardless of workspace, Microsoft doesn’t provide a single REST API that returns a full end‑to‑end lineage. Instead:
The workspace lineage view in the Power BI Service UI shows relationships between datasets, reports, and dataflows visually.
See Microsoft’s documentation here: Lineage view in Power BI Service.Programmatically, you need to stitch lineage together by combining multiple REST API calls:
Reports – Get Reports
Reports – Get Datasources
Datasets – Get Datasources
Gateways – Get Gateways
By exporting and joining these results, you can build your own lineage table/report that spans across workspaces.
For Fabric, the REST APIs are documented here: Fabric REST API documentation structure.
While there isn’t a dedicated “lineage API,” you can query items (datasets, reports, dataflows) and reconstruct lineage yourself.So in short: lineage is available in the UI per workspace, but across workspaces you’ll need to build it by combining API outputs.
Thanks for coming back to me
I have been using the Rest APIs quite a lot - I found one which can get the datasource/connection directly for a single report/dataset.
I am struggling for a multiple connections though. I will need to think this through.
Thanks for helping!
- Olufemi78 months ago
Super User
Hi KarenL7,
Yes, this issue has already been solved in the Power BI Community.
The confirmed approach is to loop through all reports and datasets using the Power BI REST APIs. That way, you’ll capture all connections, not just one.Reports – Get Reports → list all reports.
Reports – Get Datasources → returns all connections tied to each report.
Datasets – Get Datasources → shows all underlying connections, including multiple ones.
Gateways – Get Gateways → cross-check datasource IDs against gateway connections.
Most admins automate this with PowerShell or Python, exporting results to CSV/Excel for easier review.
For reference, community member Ynr0225 raised this exact question, and Zhu from the Community Support Team provided a working solution with sample M code.
You can see the full thread here: PowerShell script to retrieve list data sources used in Power BI dataset
This confirms that looping through reports/datasets solves the multiple connections issue, and the same method works in Microsoft Fabric notebooks too since Fabric integrates Power BI and uses the same REST APIs.- KarenL78 months ago
Advocate V
HI Olufemi7
Thanks for sharing the question / answer. I already have Mcode like this as I have a number of the Rest APIs into a Power BI report already.
It already shows me all the gateways / datasets / reports / datasources for workspaces.
The method has solved how to get multiple datasources a workspace. I will try this.
I was hoping for an Rest API to show me a lineage of connection to reports regardless of workspace I think.
Thanks for the help.
Karen
- Olufemi78 months ago
Super User
Hi KarenL7,
Great to hear the REST API/M code approach is already working for you to list gateways, datasets, reports, and datasources across workspaces — that’s exactly how most admins solve the multiple connections issue.
For the lineage view across reports regardless of workspace, Microsoft doesn’t provide a single REST API that returns a full end‑to‑end lineage. Instead:
The workspace lineage view in the Power BI Service UI shows relationships between datasets, reports, and dataflows visually.
See Microsoft’s documentation here: Lineage view in Power BI Service.Programmatically, you need to stitch lineage together by combining multiple REST API calls:
Reports – Get Reports
Reports – Get Datasources
Datasets – Get Datasources
Gateways – Get Gateways
By exporting and joining these results, you can build your own lineage table/report that spans across workspaces.
For Fabric, the REST APIs are documented here: Fabric REST API documentation structure.
While there isn’t a dedicated “lineage API,” you can query items (datasets, reports, dataflows) and reconstruct lineage yourself.So in short: lineage is available in the UI per workspace, but across workspaces you’ll need to build it by combining API outputs.