Forum Discussion
Custom Usage Metrics Report (for all reports and all workspaces)
I have an ambitious plan to create a single "golden" report to monitor the usage of all reports across all workspaces.
What would be the best approach for this?
Has anyone done something similar and could share insights or tutorials?
I was able to connect to the Power BI API, but I’m not entirely sure where to find all the necessary information.
The first issue I encountered is that I’m sharing reports via apps (not direct report links), and access is granted based on Azure AD groups (not individual emails). However, when querying the API (GetAppUsersAsAdmin and similar queries), I only get group email addresses in the results, whereas I would like to see individual users.
Could you please help?
Hi LuigiBros ,
Favourable Approach is:
-
Connect to Power BI REST API
- Use the Admin API to get usage details across workspaces.
- Key endpoints:
- GetActivityEvents → Fetch user activity logs.
- GetReportsAsAdmin → List all reports.
- GetAppUsersAsAdmin → Fetch app access details.
-
Extract Individual Users from Azure AD Groups
- API returns group emails, not individual users.
- Use Microsoft Graph API (/groups/{id}/members) to expand group members.
- Store user mappings in a separate dataset.
-
Build a Power BI Report
- Load API data into Power BI via Power Query (Web Connector).
- Model relationships between reports, workspaces, users, and access logs.
- Use DAX measures for insights like most-viewed reports, active users, and trends.
Challenges & Solutions:Issue: API limits (e.g., GetActivityEvents pulls 30 days of data).
➡ Solution: Schedule incremental refresh for continuous tracking.Issue: Access data is in groups, not users.
➡ Solution: Use Microsoft Graph API to resolve group members.-
5 Replies
- audreygerred
Super User
Hi! If you are able to get access to the audit logs you should be able to create whatever you want. It holds 90 days worth of info, so if you want to build it out for longer, have the data stored in your data warehouse and refresh it daily and connect PBI to your warehouse. Track user activities in Microsoft Fabric - Microsoft Fabric | Microsoft Learn
- rohit1991
Super User
Hi LuigiBros ,
Favourable Approach is:
-
Connect to Power BI REST API
- Use the Admin API to get usage details across workspaces.
- Key endpoints:
- GetActivityEvents → Fetch user activity logs.
- GetReportsAsAdmin → List all reports.
- GetAppUsersAsAdmin → Fetch app access details.
-
Extract Individual Users from Azure AD Groups
- API returns group emails, not individual users.
- Use Microsoft Graph API (/groups/{id}/members) to expand group members.
- Store user mappings in a separate dataset.
-
Build a Power BI Report
- Load API data into Power BI via Power Query (Web Connector).
- Model relationships between reports, workspaces, users, and access logs.
- Use DAX measures for insights like most-viewed reports, active users, and trends.
Challenges & Solutions:Issue: API limits (e.g., GetActivityEvents pulls 30 days of data).
➡ Solution: Schedule incremental refresh for continuous tracking.Issue: Access data is in groups, not users.
➡ Solution: Use Microsoft Graph API to resolve group members.- LuigiBros
Helper I
Thanks, it is very helpful.
-
- LuigiBros
Helper I
do you know if it is possible to join together all Usage Metrics Reports from all workspaces into one?
And is it possible to add additional table to the model?
I want to export all users from Azure AD with Power BI license and check how many of them are not using reports at all.
- hyodokatsukiFrequent Visitor
Using Semantic Link, you can extract data from the Usage Metrics semantic model in a notebook. By incrementally updating and accumulating the data appropriately, you can also enable long-term analysis. By parameterizing the workspace portion, you can consolidate data across multiple workspaces.
Since GetActivityEvents does not include page-level view information, it is ideal to extract data from Usage Metrics instead.
%%pyspark import sempy.fabric as fabric workspace = "<workspace_name>" dataset = "Usage Metrics Report" table_name = "Report Page views" dax = f"EVALUATE '{table_name}'" df = fabric.evaluate_dax(dataset, dax, workspace=workspace)