Forum Discussion

xhan's avatar
xhan
Icon for Helper I rankHelper I
4 years ago

Power BI Rest APIs to get report's source tables and fields

Hi friends,

I'm trying to use the Power BI Rest API to fetch report's source tables (tables in sqlserver or other storage), and the fields from those tables used in the reports. What would be the best APIs for getting these info?

 

I was looking at the dataset, dataflows APIs, but seem not containing the detailed info, or I missed something?

 

Thanks in advance!:)

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi xhan ,

    You can refer the following links to get it.

    Announcing new Admin APIs and Service Principal authentication to make for better tenant metadata scanning

    Admin - WorkspaceInfo GetScanResult

    GET https://api.powerbi.com/v1.0/myorg/admin/workspaces/scanResult/{scanId}

    Getting Power BI Measures and Columns via REST API

    The Power BI API returns admin info on the state of a dataset, but not the data structure.

    If the dataset is compatible and the XMLA endpoint for the workspace is open, you can connect to that and use it like you would an Analysis Services database, including getting the measures and columns. You can use any tool or custom code that implements the MSOLAP or AMODB libraries. DAX Studio is just one of these options. The url of a workspace will be powerbi://api.powerbi.com/v1.0/[tenant name]/[workspace name]


    Best Regards

    • xhan's avatar
      xhan
      Icon for Helper I rankHelper I

      Thanks a lot Anonymous ! I'm now able to use the metadata API to get the scan result. The result returns reports, and datasets. But I wonder if it's possible to get the pages and the visuals on the pages? For a visual, I'd like to get which columns, measures it's using.
      We are not using sql server or other MS data storage at this point.

       

      Thank you!