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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
eliebe-5
Regular Visitor

Difference in Calculated table and RLS

I'm having some trouble with creating an RLS Role for managing which department a user may view employees from.

 

I have a table of departments built like paths, IE:

Dep1/

Dep1/Site1

Dep1/Site1/Team1

Dep1/Site1/Team2

Dep1/Site2

Dep1/Site2/Team3

Dep1/Site2/Team4

 

Each row has a manager, which matches ids in my usertable. For a manager to be able to access departments below them I create a calculated column in the departments table so that Column = Manager & ParentManager & GrandParentManager.

 

So my role filter is: (OrganizationalEntity is department and Solution is my aggregated column)

VAR USERID =
CALCULATE(
 FIRSTNONBLANK( SystemUser[systemuserid], 1),
 FILTER( ALL( SystemUser ), SystemUser[Domain Name] = USERPRINCIPALNAME()
 )
)

RETURN
IF(
IFERROR(SEARCH(USERID, OrganizationalEntity[Solution]), -1) > -1,
TRUE,
FALSE
)

But this simply leaves me with all departments with a nonblank "Solution" column.

 

If I instead create a calculated table, use the same definition for USERID but swap userprincipalname() for my email, like this:

TestTable = 

VAR USERID =
CALCULATE(
 FIRSTNONBLANK( SystemUser[systemuserid]; 1);
 FILTER( ALL( SystemUser ); SystemUser[Domain Name] = "MYEMAIL@DOMAIN.COM"
 )
)

RETURN
    CALCULATETABLE(
        OrganizationalEntity;
        FILTER(
            OrganizationalEntity;
            IF(
            IFERROR(SEARCH(USERID; OrganizationalEntity[Solution]); -1) > -1;
            TRUE;
            FALSE
            )
        )
    )

This generates a table with expected results.

Is this a bug? Or am I just missing something?

 

EDIT: I want to add that I have tried simply OrganizationalEntity[Manager] = USERID, and that works as expected in RLS, so USERID seems to be correct.

0 REPLIES 0

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.