Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.