cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alexjclark
Regular Visitor

RLS Across multiple columns in a table

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!

1 REPLY 1
lbendlin
Super User
Super User

Add the OR condition to the DAX code for your RLS rule.  use OR()  or  ||  (double pipe).

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors