The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi All,
I am hoping find help to my current issue. I have got to implement a Dynamic RLS for hierachy over multiple columns of a dimension table.
The requirement consist of implementing an hierachy restriction as follow
Besides, an employee/manager can have access to a top level of the hierachy and have his staff accessing only few part of a level (including the belonging part of the below level). => hope this illustraction is clear enough.
However, I am having to deal with the blisted below tables:
Thank you for your help
Hi @123abc ,
Thank you for your proposition. I like to implemented it just that i still a bit more clarification as in if i should create a physical relationship between the Dim and the bridge table. also, you've not mentioned where to add the dax (which RLS table). then a confusing point is when you've stated i should use a calculated table to insert into my RLS choice. May you please guide toward which colum and table would carry the DAX.
The tables you mentioned are:
From your description, it seems like you want to implement a dynamic RLS based on a hierarchy, where an employee/manager can have access to a top level of the hierarchy, and their staff can access only a portion of a level and the belonging part of the below level.
Here is a general approach you can take:
Define the Hierarchy in the Dimension Table:
Create Relationships:
Create RLS user_Group Table:
Create Bridge Table:
Define DAX Expressions for RLS:
Here's an example DAX expression for RLS in Power BI:
=
CALCULATETABLE(
'YourDimensionTable',
USERELATIONSHIP('BridgeTable'[UserID], 'RLS user_Group Table'[UserID]),
'YourDimensionTable'[EmployeeID] IN VALUES('RLS user_Group Table'[EmployeeID])
|| 'YourDimensionTable'[ManagerID] IN VALUES('RLS user_Group Table'[EmployeeID])
|| 'YourDimensionTable'[GrandManagerID] IN VALUES('RLS user_Group Table'[EmployeeID])
)
This DAX expression checks if the user has access to the specified EmployeeID, ManagerID, or GrandManagerID based on the relationships established through the Bridge Table.
Remember to replace 'YourDimensionTable', 'BridgeTable', and 'RLS user_Group Table' with the actual names of your tables.
Adjust the DAX expression based on your specific hierarchy and table structures. It's important to test the RLS rules thoroughly to ensure they provide the desired level of security.
If you encounter specific issues or have more details to provide, feel free to share them for more targeted assistance.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |