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 to filter data in a table from a set of data on another table

Hi,

I have to filter the report based on the branches the user has access to. I have a table called BRANCHESLIST which carries the information of branch numbers and user emails.

HariniParthiban_0-1712926674741.png

ASSETSETUPVIEW is the table I want to filter. Using filter directly on RLS throws an error:

HariniParthiban_1-1712926805809.png

I created a measure 

FilteredTable =
SUMMARIZE(
    FILTER(
        BRANCHESLIST,
        BRANCHESLIST[EMAIL_FW] = USERPRINCIPALNAME()
    ),
    BRANCHESLIST[COSTCENTRE_FW]
)

and then used RLS which gives the following error:

HariniParthiban_2-1712926921376.png

How can I filter the table in this scenario?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

 

You can place the following code:

var UPN=USERPRINCIPALNAME()
var UserRow=
    CALCULATETABLE(
        'BRANCHESLIST',
        'BRANCHESLIST'[EMAAIL_FW]=UPN)
var Flag=
SELECTCOLUMNS(
    UserRow,'BRANCHESLIST'[COSTCENTER])
var Result=
FILTER(
'ASSETSETUPVIEW','ASSETSETUPVIEW'[COSTTCENTRE_FW] in Flag)
RETURN
IF(
    'ASSETSETUPVIEW'[COSTTCENTRE_FW] in Flag,TRUE(),FALSE())

vyangliumsft_0-1713161297780.png

vyangliumsft_1-1713161297781.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @Anonymous ,

 

You can place the following code:

var UPN=USERPRINCIPALNAME()
var UserRow=
    CALCULATETABLE(
        'BRANCHESLIST',
        'BRANCHESLIST'[EMAAIL_FW]=UPN)
var Flag=
SELECTCOLUMNS(
    UserRow,'BRANCHESLIST'[COSTCENTER])
var Result=
FILTER(
'ASSETSETUPVIEW','ASSETSETUPVIEW'[COSTTCENTRE_FW] in Flag)
RETURN
IF(
    'ASSETSETUPVIEW'[COSTTCENTRE_FW] in Flag,TRUE(),FALSE())

vyangliumsft_0-1713161297780.png

vyangliumsft_1-1713161297781.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.