Forum Discussion
Need help creating Row Level Security based on the Department Name in the Table
- 1 year ago
Hi Jadegirlify ,
For this you would need to have a formula in the department column that would get the department for the current login something similar to:
var selecteduserdepartment = MAXX(FILTER(Users, Users[email] = USERPRINCIPALNAME()), Users[Department]) RETURN Users[Department] = selecteduserdepartmentThis will allow you to do the filter you need:
This need to be applied to the user table:
My only question is what do you mean when you say that "These employee are not members in the workspace. The report will only be published and shared via powerbi online link"?
What is the Power BI Online Link? Is it the Share to Web link? that this is not a secure link and RLS will not work on top of it?
RLS only works within the service and can be trough a workspace or giving acces to an app.
Hi Jadegirlify ,
For this you would need to have a formula in the department column that would get the department for the current login something similar to:
var selecteduserdepartment = MAXX(FILTER(Users, Users[email] = USERPRINCIPALNAME()), Users[Department])
RETURN
Users[Department] = selecteduserdepartment
This will allow you to do the filter you need:
This need to be applied to the user table:
My only question is what do you mean when you say that "These employee are not members in the workspace. The report will only be published and shared via powerbi online link"?
What is the Power BI Online Link? Is it the Share to Web link? that this is not a secure link and RLS will not work on top of it?
RLS only works within the service and can be trough a workspace or giving acces to an app.