Forum Discussion
Manage Roles - set row security level help
- 8 years ago
You can create a dynamic RLS with the function USERNAME() or USERPRINCIPALNAME(), that function will return the power bi user email, so you will have to create a table with all users email like [email protected] Tom and to make a relationship between that table to your Manager dimension. thats way you will have to make only 1 RLS rule. you can read more about it here:
http://radacad.com/dynamic-row-level-security-with-profiles-and-users-in-power-bi
You can create a dynamic RLS with the function USERNAME() or USERPRINCIPALNAME(), that function will return the power bi user email, so you will have to create a table with all users email like [email protected] Tom and to make a relationship between that table to your Manager dimension. thats way you will have to make only 1 RLS rule. you can read more about it here:
http://radacad.com/dynamic-row-level-security-with-profiles-and-users-in-power-bi
- Randalnik8 years agoFrequent Visitor
Hello Drors,
thanks so much for your help. I was looking for something like this article.
I have tried the 1. solution and nothing happened.
I have tried the 2. solution. I Prepared the model, data, formulated DAX just like in an article but im not able to see anything.
I'm logged in in my acc in Power BI Desktop and this email is contained in the table of users.
Right below is the model (Sorry, I dont have any time to translate it to english (its in czech)).
Zam_Detail = User
Zam_Pob_Security = User_Profile
Vydejni_Misto = Profile
Theres DAX saved in Vydejni_Misto in Manage Roles:
[Pobocka_Id] IN SELECTCOLUMNS (
FILTER (
'Zam_Pob_Security',
RELATED(Zam_Detail[Email])
=USERPRINCIPALNAME()),
"Vydejni_Misto",[Pobocka_Id])I really know its hard to understand without seeing all the details or daa, but do you have some idea, how to fix it?
Thanks, R.
- Drors8 years agoResolver III
Hi,
Hi, It little bit hard to me to know excatly where is the problem but I can suggest some things,
in the first way: try to login to power bi cloud with diffrent user and check if its work (after publishing the new model and add the second user to the security in the cloud).
for the second way : try to write the DAX RLS in a measure, then put it in a card visual and check what is the output. if you dont get the desired output try change it a little bit untill it will be ok.
for both ways : you should check is that you dont have duplicates in your emails in the User table, press on the remove duplicates and then add an Index as a ID, make a relationship with the ID between the User and the User profile tables.
I used that article several times and its work fine to me.. so Im sure you will handle it also.
Regards,
Dror