Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
shreyasr
Regular Visitor

Power BI Filter data based on user based on Azure AD attribute

I have a requirement to filter data in power BI based on user .

So when a user logs in Power BI desktop

  1. Can we trigger Power BI query on user login to call Microsoft Graph API to get user attributes
  2. once we have this data , we filter data based on the attributes .

So in short , Can i trigger a graph api call on power BI login and filter data based on response .

Thanks,

Shreyas

1 REPLY 1
v-stephen-msft
Community Support
Community Support

Hi @shreyasr ,

 

Yes, it is possible to trigger a Graph API call on Power BI login to get user attributes and filter data based on the response. You can use the Power Query SDK to create a custom data connector that calls the Graph API and retrieves the user attributes. Then, you can use row-level security (RLS) to filter the data based on the user attributes. RLS is a feature that allows a dataset owner to restrict access to the data for the users consuming it. This is done via roles, that users are assigned to. Each role is basically a DAX expression, and there's 2 types of such roles/expressions: regular/static RLS, where the same filter is applied to all users in that role, and dynamic RLS, where the filtering condition uses the username() or the userprincipalname() functions. Those functions resolve to the domain name / UPN of the user visualizing the data, which means that the filtering condition will be different for each user.

 

 

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors