Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Folks,
I need help regarding RLS, Any help would be realy appriciated.
I have role for individual users in database and based on that role I want to set row level security in Power BI, the example is as below
role:
l1,l2,l3,l4,l5,
l1 role will have operator level access
l2 role will have branch level access
l3 role will have customer level access
l4 role will have location level access
l5 role will have pos level access
Now I have separate dim tables for all this operator, branch, customer, location and POS
But l1 role will have only specific access of operatoe let say
user 1 has role l1 and we have two operator in operator table op1 and op2 but user 1 will have only access of op1 not for the data of Op2.
I have same scenario for branch, customer, location and POS what should I do
I have relationship between this tables is as below:
operator and branch table has one to many relationship
branch and customer has one to many relatonship
customer and location has one to many relatonship
location and POS has one to many relatonship
Thanks in advance.
Solved! Go to Solution.
Hi @Rahul_2992
You can enter the following dax expression in the row-level security expression box:
[OperatorID] IN
(SELECTCOLUMNS(FILTER('UserMapping', 'UserMapping'[UserLogin] = USERPRINCIPALNAME()
&& 'UserMapping'[Role] = "L1"),
"OperatorID", 'UserMapping'[OperatorID]))
This DAX formula assumes you have a UserMapping table with UserLogin, Role, and OperatorID columns. It filters the operator data to only show the operators that the logged-in user has access to based on their role.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Rahul_2992
You can enter the following dax expression in the row-level security expression box:
[OperatorID] IN
(SELECTCOLUMNS(FILTER('UserMapping', 'UserMapping'[UserLogin] = USERPRINCIPALNAME()
&& 'UserMapping'[Role] = "L1"),
"OperatorID", 'UserMapping'[OperatorID]))
This DAX formula assumes you have a UserMapping table with UserLogin, Role, and OperatorID columns. It filters the operator data to only show the operators that the logged-in user has access to based on their role.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey, @v-jialongy-msft
Thanks for your reply,
I have sorted out how to apply RLS based on different hierarchy level and users permission.
I really appriciate for your help and time.
Thanks.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
106 | |
88 | |
74 | |
69 |
User | Count |
---|---|
123 | |
112 | |
95 | |
83 | |
73 |