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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.