Forum Discussion
DiKi-I
1 year agoPost Partisan
Row level security help
Can I use username() for row level security instead of userprincipalname(). I have ad user name in the table but not user email. Could you please let me know if this will work. Also my table is in di...
- 1 year ago
yes this approach also works
just to be sure that the name your have in the table is in the right format
Create a measure _Test = Username()
Then add this measure in a card, to see how it is formatted vs what you have in the table (maybe you will have to add the domain in the list)
v-csrikanth
1 year agoCommunity Support
Hi DiKi-I
In addition to Idrissshatila Cookistador below additional suggestions for implementing Row-Level Security (RLS) in Power BI.
- Dynamic RLS using USERNAME() or USERPRINCIPALNAME(): Store user-to-data mappings in a table and filter based on the logged-in user dynamically.
- Using security groups: Assign roles via Azure AD security groups and filter data based on group membership.
- Testing RLS using "View as Role": Always validate roles in Power BI Desktop before publishing.
- Combining static and dynamic RLS: Use hybrid logic for more complex access control scenarios.
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.