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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Query1: Need to put RLS on the basis of Country,TeamName,Process in the Main Table.
Another Table called UserMapping where we have Email,Country,TeamName,Process, Role (basis of role we have to take Country&TeamName,TeamName&Process, Only Country etc.
Here I put RLS on UserMapping to know the Role,Country,TeamName,Process, So that I can filter our Main Table.
Query2: How can we store UserprincipalName() in the Table or Somewhere else so that I can use username in our Main Table/Column. (UserprincipalName() can not support in Table/Column).
Solved! Go to Solution.
Solved:
What I did here,
Syntax : Manage Role sections only.
VAR _upn=USERPRINCIPALNAME()
VAR _Country='Main Table'[Country] IN CALCULATETABLE(VALUES(' UserMapping '[Country]),' UserMapping '[EMail]=_upn)
VAR _CountryAndProcess='Main Table'[CountryAndProcess] IN CALCULATETABLE(VALUES('UserMapping'[CountryAndProcess]),' UserMapping '[EMail]=_upn)
VAR _None='Main Table'[CountryAndTeam] IN CALCULATETABLE(VALUES('UserMapping'[CountryAndTeam]),' UserMapping '[EMail]="None")
return
IF(_TypeMapping="ABC" && CONTAINSSTRING([_RoleMapping],"Manager") ,_Country
,IF(_TypeMapping="XYZ" && (CONTAINSSTRING([_RoleMapping],"Country Head") || CONTAINSSTRING([_RoleMapping],"Developer")) ,_CountryAndProcess,_None))
Solved:
What I did here,
Syntax : Manage Role sections only.
VAR _upn=USERPRINCIPALNAME()
VAR _Country='Main Table'[Country] IN CALCULATETABLE(VALUES(' UserMapping '[Country]),' UserMapping '[EMail]=_upn)
VAR _CountryAndProcess='Main Table'[CountryAndProcess] IN CALCULATETABLE(VALUES('UserMapping'[CountryAndProcess]),' UserMapping '[EMail]=_upn)
VAR _None='Main Table'[CountryAndTeam] IN CALCULATETABLE(VALUES('UserMapping'[CountryAndTeam]),' UserMapping '[EMail]="None")
return
IF(_TypeMapping="ABC" && CONTAINSSTRING([_RoleMapping],"Manager") ,_Country
,IF(_TypeMapping="XYZ" && (CONTAINSSTRING([_RoleMapping],"Country Head") || CONTAINSSTRING([_RoleMapping],"Developer")) ,_CountryAndProcess,_None))
What is the question for Query1?
For Query2: You need to decide if you want to do static RLS (based on role membership) or dynamic RLS (based on USERPRINCIPALNAME). If you data already has an email address field in a dimension table then you can add the RLS rule to that table.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.