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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

RLS statement is not defined as the type true/false

Hi, 

In RLS I wish to give access to all data for the managers and only their own data for others. I created, to test, two simple tables; one Sales rep-table with ID, Mail and IsManager (1 for yes, 0 for no) and a Sales transactions-table with ID and sales number. 

I create a calc measure to see if the logged in user is a manager or not by using 

IsManager sales rep =
MAXX(
FILTER(
'Sales rep';
'Sales rep'[Mail] = USERPRINCIPALNAME());
'Sales rep'[IsManager])

This works fine and gives me an "1" or "0". 

I then want to create a RLS-statement to show all sales if the logged in user is a manager and only their own data if not by using this dax
IF(
MAXX(
FILTER(
'Sales rep',
'Sales rep'[Mail] = USERPRINCIPALNAME()),
'Sales rep'[IsManager]) = 0,
USERPRINCIPALNAME(),
1=1)

However, PBI tells me its incorrect because the RLS statement defined for the table is not defined as the type true/false. 

How is that, when IF( statements give a true/false result?

Thanks,

Mikkel Hyldig
1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found a simple solution.

 

I created a new column [All] in the sales rep-table with "1" on every row. I then created a RLS role "Managers" with the formula "[All] = 1" on the sales rep-table. Then I created RLS role "Others" with the formula "[Mail] = UserPrincipalName" on the sales rep-table. 
 Im now able to add members to the two groups whether they are managers or not. 

/Mikkel 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I found a simple solution.

 

I created a new column [All] in the sales rep-table with "1" on every row. I then created a RLS role "Managers" with the formula "[All] = 1" on the sales rep-table. Then I created RLS role "Others" with the formula "[Mail] = UserPrincipalName" on the sales rep-table. 
 Im now able to add members to the two groups whether they are managers or not. 

/Mikkel 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.