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 for 2 dimensions

The project is about moving between projects.

I have two RLS tables (RLS_origem and RLS_destino), one for the source project(RLS_origem) and the other for the target project(RLS_destino), where I have the user logins (column: email_longin) and the projects released for each one (rls_sk_projeto). In my fact table (fato), I have two columns, one for the source project (sol_origem_sk_prrojeto) and one for the target project (sol_destino_sk_prrojeto).
With this, I need to create an RLS where the project released to the user is present in the source project or target project column in my fact table.

 

felipemacgregor_0-1713219454209.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The issue was resolved with the following solution:

 

SOLUTION: 

(
        [sol_origem.sk_projeto] IN SELECTCOLUMNS(
            FILTER(
                'RLS_origem',
                'RLS_origem' [email_login] = USERNAME()
            ),
            "Project",
            [rls_sk_projeto_orig]
        )
    ) || (
        [sol_destino.sk_projeto] IN SELECTCOLUMNS(
            FILTER(
                'RLS_destino',
                'RLS_destino' [email_login] = USERNAME()
            ),
            "Project",
            [rls_sk_projeto_dest]
        )
    )

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

The issue was resolved with the following solution:

 

SOLUTION: 

(
        [sol_origem.sk_projeto] IN SELECTCOLUMNS(
            FILTER(
                'RLS_origem',
                'RLS_origem' [email_login] = USERNAME()
            ),
            "Project",
            [rls_sk_projeto_orig]
        )
    ) || (
        [sol_destino.sk_projeto] IN SELECTCOLUMNS(
            FILTER(
                'RLS_destino',
                'RLS_destino' [email_login] = USERNAME()
            ),
            "Project",
            [rls_sk_projeto_dest]
        )
    )

 

Anonymous
Not applicable

Hi @Anonymous ,

 

The following recommendations are for reference:

  • Create RLS Tables: Make sure you have two RLS tables named RLS_origem and RLS_destino. These tables should contain user login information (email_login) and information about items posted by each user (rls_sk_projeto).
  • Create Relationships: Ensure that there are relationships between the RLS tables and the fact table (fato). These relationships should be based on the email_login column.
RLS_Permission =
VAR UserProjects =
    UNION (
        VALUES ( 'fato'[sol_origem_sk_prrojeto] ),
        VALUES ( 'fato'[sol_destino_sk_prrojeto] )
    )
RETURN
    IF (
        CONTAINS (
            UNION ( 'RLS_origem', 'RLS_destino' ),
            'RLS_origem'[email_login], USERNAME ()
        )
            && COUNTROWS (
                INTERSECT ( VALUES ( 'RLS_origem'[rls_sk_projeto] ), UserProjects )
            ) > 0,
        BLANK (),
        IF (
            CONTAINS (
                UNION ( 'RLS_origem', 'RLS_destino' ),
                'RLS_destino'[email_login], USERNAME ()
            )
                && COUNTROWS (
                    INTERSECT ( VALUES ( 'RLS_destino'[rls_sk_projeto] ), UserProjects )
                ) > 0,
            BLANK (),
            1
        )
    )

 

Best Regards,
Adamk Kong

 

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.