Forum Discussion

devGV_88's avatar
devGV_88
Helper I
1 year ago
Solved

Help with Power BI API for Exporting Report Usage Data

Hi folks, I’m looking for guidance on how to export a list or connect Power BI Desktop to the Power BI API to periodically retrieve data about all the reports in my tenant. Specifically, I need info...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi devGV_88 ,

    Currently, there is no API that can directly meet your needs, nor can you rely solely on the API to meet your needs. I can give you an idea for implementation.

    First, use the API to get reports for all workspaces. This API will have a Workspace name column, and report name, report id columns. Create a data table Factworkspace or FactReport in Power BI based on the results obtained from the API.
    Reports - Get Reports In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
    Groups - Get Groups - REST API (Power BI Power BI REST APIs) | Microsoft Learn

    Then, use the API to get the user access rights for each report. This table contains a username, userremail, report, role, permission, report name, report id column, etc. And use this data to create a user permission table FactUser in Power BI.
    Admin - Reports GetReportUsersAsAdmin - REST API (Power BI Power BI REST APIs) | Microsoft Learn

    By establishing a connection between the two tables, you can count users and analyze them by workspace and report dimensions.

    Power BI Service has usage metrics for each report. Use the usage metrics data to create a third data table, and connect the previous two reports for analysis based on report id and workspace id. This way, you can know which users have viewed this report in the current time period, which reports they have viewed, and in which workspace each user is in. Or you can use the API mentioned in my first reply, as long as you can get the corresponding timestamp, report id, user id, email, which can record the user identity and viewing time and content, it will be fine.
    Monitor report usage metrics - Power BI | Microsoft Learn

    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.