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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
NJ81858
Helper IV
Helper IV

Row Level Security Returning Error

Hello,

 

I am trying to configure a role that will show data depending on where the user falls on the company hierarchy, but I am receiving an error when I combine the statements into one.

 

My employee list is just a singular list, and I have created custom columns to refer to the different levels of the hierarchy. 

 

My role is defined as: 

IF(
LOOKUPVALUE(User[Role], User[Email], [Current User]) = "Tier1", User[Email] = [Current User], 
IF( LOOKUPVALUE(User[Role], User[Email], [Current User]) = "Tier2", User[Tier2Email] = [Current User],
true))

 

Where my [Current User] measure is:

Current User = USERPRINCIPALNAME()

 

The roles should be something to the effect of:

1. If the current user is Tier 1, then only show them their records

2. If the current user is Tier 2, then show them their team's records

3. Otherwise show them everyone's records

 

I also have confirmed that each statement works when by itself, there are just issues when I combine everything into one.

 

Thank you in advance!

1 REPLY 1
lbendlin
Super User
Super User

var cu = USERPRINCIPALNAME()
return
IF( LOOKUPVALUE(User[Role], User[Email], cu) = "Tier1", User[Email] = cu, 
IF( LOOKUPVALUE(User[Role], User[Email], cu) = "Tier2", User[Tier2Email] = cu,
true()
))

 

However - the User table would need to participate in the data model which doesn't seem to be the case as you are using LOOKUPVALUE.   You may need to show more of your setup.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors