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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Daniel29195
Super User
Super User

RLS not working

Hello,
im testing the dynamic RLS, 
i have the following table. 

Daniel29195_0-1685306218921.png


RLS formula 1 ; 

VAR _key =
CALCULATEtable(
values('Table'[empid]),

'Table'[adress] = username())


RETURN
PATHCONTAINS('Table'[emppath], _key )

 

testing RLS on test1 :  test1 , should see all other users. ( the above code doesnt worrk)

Daniel29195_2-1685306287283.png

Daniel29195_3-1685306333917.png




 

RLS formula 2 : 
VAR _key =
CALCULATEtable(
values('Table'[empid]),
filter(
'Table',
'Table'[adress] = username())
)

RETURN
PATHCONTAINS('Table'[emppath], _key )

 

with this code, 
the RLS works. 

Daniel29195_4-1685306415996.png

 

so im confused about why the first code didnt work .

 

 

any help explaining the reason why the first code didnt work correctly, but the second did would be appreciated,

 

 

 



1 REPLY 1
Mahesh0016
Super User
Super User

 

@Daniel29195 

Go to manage role 
select table column 
for E.g [Adress] = USERNAME() click OK.
Than
Go to View As 

Check 

Mahesh0016_1-1685361753491.png

Mahesh0016_2-1685361781554.png

 


@Daniel29195 I hope this helps you!THANK YOU!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.