Forum Discussion
retrieve source table-level lineage for Power BI reports
- 1 year ago
Hello AdityaPrasad
The Power BI REST API provides a structured way to extract metadata, including lineage information, from your Power BI environment. The Metadata Scanner API, in particular, is designed for extracting detailed metadata about datasets, tables, columns, and their relationships.
https://www.brunner.bi/post/complete-semantic-model-lineage-in-the-power-bi-service-1
https://powerbi.microsoft.com/en-us/blog/new-scanner-api-scenarios
1. List Workspaces: Use the `GetGroupsAsAdmin` API to retrieve all workspace IDs in your tenant.
• Endpoint: `GET https://api.powerbi.com/v1.0/myorg/admin/groups?$top=5000`
2. Scan Workspaces: Use the `PostWorkspaceInfo` API to initiate a metadata scan for specific workspaces.
• Endpoint: `POST https://api.powerbi.com/v1.0/myorg/admin/workspaces/getInfo?lineage=True&datasourceDetails=True`
• Include workspace IDs in the request body.
3. Retrieve Scan Results: Use the `GetScanResult` API to fetch the scan results containing lineage data.
• Endpoint: `GET https://api.powerbi.com/v1.0/myorg/admin/workspaces/scanResult/{scanId}`
4. Parse Results: Extract and analyze the JSON response to identify relationships between Power BI tables and their source tables.
You may want to consider using Purview, or at least the Scanner API.