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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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