Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a requirement to filter data in power BI based on user .
So when a user logs in Power BI desktop
So in short , Can i trigger a graph api call on power BI login and filter data based on response .
Thanks,
Shreyas
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.