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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.