Forum Discussion
RLS multiple combination
- 7 years ago
I just remembered that I had to do something strange with my tables which required me to use the OR. For yours, you should be able to just use the following:
- On the company table - Company[PrincipalName] = UserPrincipalName()
- On the department table - Department[PrincipalName] = UserPrincipalName()
If it doesn't work for you I will work up a PBIX file that I can share to demonstrate what I am thinking.
Hi there,
I created Security roll and compusite key CDKEY = Company + Department to generate unique key Matching to UserPrincipalName Also I created companyDepartment combination table then I put this code (it seems working)
But I'm not happy with this solutions.
CompanyDepartment[CDKEY]= CALCULATE(
VALUES('SecurityTable'[CDKEY]),
SUMMARIZE(
SecurityTable,
SecurityTable[CDKEY]),
SecurityTable[PrincipalName] = UserPrincipalName()
)
I did try two tables like you showed but it did not work as expected , I will try one more time and let you know.
Can you elaborate a liitile bit more about your code?
Thanks,
Oded Dror
I just remembered that I had to do something strange with my tables which required me to use the OR. For yours, you should be able to just use the following:
- On the company table - Company[PrincipalName] = UserPrincipalName()
- On the department table - Department[PrincipalName] = UserPrincipalName()
If it doesn't work for you I will work up a PBIX file that I can share to demonstrate what I am thinking.
- Anonymous7 years agoNot applicable
Please discard the last email it works, I just test it with few users and it works!
Thanks
Oded Dror
- Anonymous7 years agoNot applicable
Hi there,
I took off the OR, Also in your image it show 1 to many relationship but in may case is many to many because one person can have access to more than one company or department and the fact table contain many company and departments.
It seems working as expected but the I published it to power BI it work only when I test the roll but not when I login?
For example I can see only 1 company 6 departments but when I login I can see all companies and departments
When I test it (Test as Roll in RLS) it works also it works in Power BI Desktop
Thanks,
Oded Dror
- Anonymous3 years agoNot applicable
Hi,
Could you tell what strange thing you did. I have a feeling it might work out for me as I am looking for a different solution for a different problem.
Thanks
- Nazirahmed19821 year agoFrequent Visitor
Hi, Please send me the pbix. I need it for a similar issue i am encountering