How to Access SharePoint Online View Statistics with User IDs in Power BI
Question details
The user needs to extract SharePoint Online site and news-view statistics, including user IDs, via API to build a Power BI report that categorizes viewers by employee type using Microsoft Entra ID data.
- Product
- Power BI / SharePoint Online
- Device & OS
- not provided
- Scenario
- Building a custom Power BI report to track SharePoint site engagement based on employee types.
- Observed behavior
- Requires API access to audit records containing the acting user's ID to join with Microsoft Entra ID data.
Ensure you have the necessary administrator permissions (such as Global Administrator or Reports Reader) in your Microsoft 365 tenant to access Microsoft Graph, Microsoft Purview audit data, and SharePoint usage reports.
Utilize Microsoft Graph and Purview Audit Data APIs
Leverage Microsoft's usage and audit APIs to extract user-specific view statistics and join them with Entra ID data in Power BI.
SharePoint usage reports, Microsoft Graph, and Microsoft Purview audit data offer different levels of detail, retention periods, and user-identification fields.
To identify viewers by employee type, you will need to extract the acting user's ID from audit logs and merge it with Microsoft Entra ID data directly within your Power BI data model.
Check that your Azure AD app registration has the required permissions for Microsoft Graph (e.g., Reports.Read.All) and Microsoft Purview.
Use the Office 365 Management Activity API or Microsoft Purview to pull detailed audit records that include the acting user's ID and file or page access events.
Import Microsoft Entra ID (formerly Azure AD) data into your Power BI dataset to map the extracted user IDs to specific employee types and departments.
Post your specific report design and API queries in the official Power BI community forum to get dedicated assistance from Microsoft Graph specialists.
Looking for a Lightweight Office Suite? Try WPS Office
While building complex Power BI reports for SharePoint requires specialized Microsoft tools, WPS Office provides a lightweight, free alternative for your everyday document, spreadsheet, and presentation needs.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install and Launch: Run the installer, follow the on-screen instructions, and open WPS Office to access Writer, Spreadsheets, and Presentation.
- 3. Open Existing Office Files: Simply drag and drop your existing .docx, .xlsx, or .pptx files into the WPS interface to view and edit them immediately.

Frequently Asked Questions
Why are user IDs anonymized in my SharePoint usage reports?
By default, Microsoft 365 anonymizes user information in usage reports to protect privacy. A Global Administrator must change this setting in the Microsoft 365 admin center under Settings > Org settings > Reports to display identifiable information.
Can I connect Power BI directly to SharePoint Online to get user statistics?
You can connect Power BI to SharePoint lists or folders, but out-of-the-box SharePoint connectors do not provide detailed historical view statistics with individual user IDs. You must use Microsoft Graph or Purview Audit logs to retrieve this granular data.
What API is best for retrieving detailed SharePoint audit records?
The Office 365 Management Activity API or Microsoft Graph APIs for Security and Purview are generally recommended for pulling detailed audit logs that contain the acting user IDs, timestamps, and specific actions.




