Hi SR
As of my knowledge cutoff in September 2021, Power BI Desktop does not provide a built-in capability to directly trigger a Graph API call upon user login. Power BI is primarily focused on data visualization and analysis rather than user authentication and authorization.
However, you can achieve the desired functionality by leveraging other tools or platforms in conjunction with Power BI. Here's a high-level approach:
- User Authentication: Implement user authentication using a separate platform or technology such as Azure Active Directory (AAD), OAuth, or custom authentication. This will provide a secure and authenticated login process for your users.
- Graph API Integration: Once the user is authenticated, you can integrate with the Microsoft Graph API within your application or backend. Use the appropriate authentication flow (e.g., OAuth 2.0) to obtain an access token to make authorized requests to the Graph API.
- Retrieve User Attributes: Make a request to the Graph API to retrieve the required user attributes for the logged-in user. You can fetch information such as user profile, group membership, or other relevant attributes that you want to use for data filtering.
- Data Filtering in Power BI: With the user attributes obtained from the Graph API, you can apply data filtering in Power BI to display only the relevant data for the logged-in user. This can be achieved by modifying your Power BI queries or applying row-level security (RLS) to restrict access to specific data based on user attributes.
- Publish Power BI Reports/Dashboards: Once the data filtering is implemented, publish the Power BI reports or dashboards to the appropriate Power BI service (e.g., Power BI Online or Power BI Report Server). Users can then access the reports with the applied data filtering based on their attributes.
It's worth mentioning that Power BI Premium and Power BI Embedded offer more advanced capabilities for row-level security, dynamic data filtering, and user attribute-based filtering. These features provide more fine-grained control over data access based on user attributes.
Keep in mind that the Power BI platform evolves over time, and there may be updates or new features that address user authentication and data filtering requirements more directly. I recommend referring to the official Power BI documentation and staying up-to-date with the latest features and enhancements.
https://learn.microsoft.com/en-us/power-bi/
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".