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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello everyone,
I am trying to set up a dynamic RLS role so that users who belong to the role can only see the data based on the email address that they used to log in. I need to map the email addresses to a "tenant_id", which will be the main filter that is used to filter all other tables.
My idea is to set up an additional table called "power_bi_users" with two columns, 'user_email' and 'tenant_id', then use dynamic RLS to specify that power_bi_users.user_email must equal username(). That row filter will then be passed through through to the tenant table via the tenant_id, which passes the tenant_id through to all other tables.
My question is whether or not this is the best approach? Or is there a way to use another function instead of username() which calls a custom "tenant_id" field instead of returning an email address?
Thanks in advance!
Seb
We have been using CustomData() since the beginning of time in Analysis services, and over a year ago, MSFT added that capability for RLS in Power BI. This is another way of doing it. The DAX filtering is very flexible, though and you can pretty much target any fields. The most important thing with RLS is to get your modeling correct so all dimension filters work correctly with measures, etc. See below for info on that feature -