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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
OrlandoChd
Frequent Visitor

RLS See certain info and ALL Info

Hello,

I need help to figure how see all info in my database for the users listed as "administrador".

 

The problem is that "Administrador" are not an option in the fact table but is an option in the dimension table "RLS".

 

Also exist blanks rows for "VISION", this should not affect the other views.

https://github.com/MathiasChaparroItau/PBI-Files 

 

Part of the Fact Table

FECHADESCRIPCIONTIPOVISIONIMPORTE
31/10/2021GASTOS ADMINISTRATIVOSFIJOMARKETING220
31/10/2021EGRESOS EXTAORDINARIOSFIJOGERENTES243
31/10/2021EGRESOS EXTAORDINARIOSPROYECTOCUENTA NUEVA154
31/10/2021GASTOS ADMINISTRATIVOSFIJO 56
31/10/2021GASTOS ADMINISTRATIVOSFIJOMARKETING131

 

Table RLS

RESPONSABLEVISTAID PerfilCORREO
Mathias ChaparroADMINISTRADOR1 
Jose BenegasADMINISTRADOR1jose.benegas@mail.com.py
Sylvana ArecoADMINISTRADOR1Sylvana.areco@mail.com.py
Adriana LopezMARKETING2 
Alfredo PronoMARKETING2Alfredo.prono@mail.com.py
Andres CubasGERENTES3 
Andrea HelenoGERENTES3Andrea.heleno@mail.com.py
Jose CardenasGERENTES3Jose.cardenas@mail.com.py
Alejandro GonzalezCUENTA NUEVA4Alejandro.gonzalez@mail.com.py
Catalina ArecoCUENTA NUEVA4Catalina.areco@mail.com.py

 

I tried to perform an RLS but it does not work, please if you verify the file, you can discard the calculation

 

Tks!

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @OrlandoChd ,

 

I think you want dynamic RLS with manager level access, please kindly refer to

Dynamic Row Level Security with Manager Level Access in Power BI - RADACAD

 

And here'my solution based on the above article.

1.Create a calculated column in RLS table.

Is Admin = IF([VISTA]="ADMINISTRADOR",1,0)

vstephenmsft_0-1638512623016.png

 

2.Create a relationship between tables. Make sure select 'Apply security filter in both directions'.vstephenmsft_1-1638512652827.png

 

3.Create a role.

If(
MaxX(
Filter(
'RLS',
'RLS'[CORREO]=Username())
,'RLS'[Is Admin])=0,
'RLS'[CORREO]=Username(),
1=1
)

vstephenmsft_2-1638513185226.png

 

Now, let's test.

vstephenmsft_3-1638513289862.png

vstephenmsft_4-1638513298646.png

 

vstephenmsft_5-1638513324761.png

vstephenmsft_6-1638513339658.png

 

Best Regards,

Stephen Tao

 

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
v-stephen-msft
Community Support
Community Support

Hi @OrlandoChd ,

 

I think you want dynamic RLS with manager level access, please kindly refer to

Dynamic Row Level Security with Manager Level Access in Power BI - RADACAD

 

And here'my solution based on the above article.

1.Create a calculated column in RLS table.

Is Admin = IF([VISTA]="ADMINISTRADOR",1,0)

vstephenmsft_0-1638512623016.png

 

2.Create a relationship between tables. Make sure select 'Apply security filter in both directions'.vstephenmsft_1-1638512652827.png

 

3.Create a role.

If(
MaxX(
Filter(
'RLS',
'RLS'[CORREO]=Username())
,'RLS'[Is Admin])=0,
'RLS'[CORREO]=Username(),
1=1
)

vstephenmsft_2-1638513185226.png

 

Now, let's test.

vstephenmsft_3-1638513289862.png

vstephenmsft_4-1638513298646.png

 

vstephenmsft_5-1638513324761.png

vstephenmsft_6-1638513339658.png

 

Best Regards,

Stephen Tao

 

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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