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
fatihcankara
Regular Visitor

Different RLS Problem

Hello,

I have a table named Budget and Employee in Power BI. The details of my Employee and Budget table are as follows. When my employee logs in powerbi login, I want him to check his login address with the e-mail address in the employee table and check the data in the department ID field in the row where his e-mail address is and in the ZZORG_D_ID field in the budget table. I want him to see the budget lines he is authorized for. Everything is perfect so far. The difficulty starts here. There can be one or more department IDs in the ZZORG_D_ID field separated by commas. When employee C logs in, he should be authorized to see budget items numbered 2,3,4. When employee D logs in, he should be authorized to see budget items numbered 3,4. When employee E logs in, he should be authorized to see budget items numbered 2,3,4. Another issue is that some employees work as managers of other departments on behalf of them. For example, employee A works in department numbered 10 and department numbered 20 on behalf of them. Thus, when logging in with the same e-mail address, the employee named A should be authorized to see the budget items with the Budget ID numbers 1,2,3,4.

 

The situations I encountered and did not work,
I created a new role in the Security section and used the '[Email] = USERPRINCIPALNAME()' DAX formula on the Employee tab, and the FILTER('Budget', CONTAINSSTRING('Bufget'[ZZORG_D_ID], SELECTEDVALUE('Staff'[Department ZORGID]))) DAX formula on the Budget page.

 

Thanks

 

Staff NamEmailDutyDepartment ZORGID
Aa@a.com.trSales10
Bb@b.com.trManager20
Cc@c.com.trFI Manager30
Dd@d.com.trBT Maneger20
Aa@a.com.trBudget Manager 20

 

Budget IdCompany CodeDetail Budfet CodeBudget NameBudget AmountZZORGID

1

F0120.10.01.01Budget A10010
2F0220.10.01.02Budget B2000

10,20

3F0120.10.01.03Budget C3000010,20,30
4F0120.10.01.04Budget D5000020,20
5 REPLIES 5
Anonymous
Not applicable

Hi @fatihcankara ,

 

You could create a security role and assign this role to your users to implement dynamic RLS. I've made a test for your reference:

vbofengmsft_3-1727676880070.png

 

vbofengmsft_0-1727676791261.png

[Email] ==  USERPRINCIPALNAME()

vbofengmsft_2-1727676835237.png

 

CONTAINSSTRING([ZZORG_D_ID],MAX(Staff[Department ZORGID]))

 

Best Regards,

Bof

 

Hi, I tried this before. But it didn't work. Thanks.

Anonymous
Not applicable

Hi @fatihcankara ,

 

This works well for me. May I ask if you have assigned roles to your users in the semantic model of the BI Service?

vbofengmsft_0-1728013415121.png

 

Best Regards,

Bof

lbendlin
Super User
Super User

There can be one or more department IDs in the ZZORG_D_ID field separated by commas. 

Try to avoid that if possible.  Instead, have separate lines for these employees with a single department each per line.  Much easier to integrate into the data model.

I'm working on different models, thanks.

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.