I have a dataset that is using a RLS hierarchy table to ensure that staff members can see anything in their name, as well as the work allocated to their direct line reports based on email addresses in a HR staffing table. This allows Directors to see everything, Regional Managers to see their regions and Contract Managers to see their own workload only;
VAR _email = USERPRINCIPALNAME()
RETURN
PATHCONTAINS(
'Grounds Maintenance Reporting Lines'[Path],
MaxX(
Filter(
'Grounds Maintenance Reporting Lines',
'Grounds Maintenance Reporting Lines'[email] = _email)
,'Grounds Maintenance Reporting Lines'[intStaffID]
)
)
However... this logic is currently applied based on a join to one field in a fact table, ManagedByID, whereas staff could actually also appear in a second role field, QuotedByID too. How can i apply the same logic to ensure that the reporting line hierarchy can be implemented to either field, rather than just the one?
If i duplicate the same reporting line table and join it to the second field, will intstaffID 1234 only see rows where they exist as both the Manager and the Quoter, or would it be a combination of all rows where they are either a Manager or a Quoter?
Help!
Add the OR condition to the DAX code for your RLS rule. use OR() or || (double pipe).
User | Count |
---|---|
200 | |
84 | |
77 | |
74 | |
56 |
User | Count |
---|---|
175 | |
102 | |
83 | |
77 | |
73 |