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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
z-rising
Frequent Visitor

Adding a restriction to RLS

I have a PBI desktop report I publish to service that uses RLS.

 

The current configuration has a table "RLS" that refreshes an excel file with the columns "Username:, Division", and "Email".  The table has a many to one cross-directional filter in both directions with security filters in both directions, connected to a table "Division" that has a single column "Division II" listing the 10 divisions of the company.  This table connects to both main data tables "Data 1" and Data 2" via a many to one single direction cross filter.

 

The RLS currently works correctly, using the DAX code  [Email] == USERPRINCIPALNAME() in a security role applied to the RLS table, so that when they log on to PBI service, it only allows them to view the data from divisions that are adjacent to their email in the RLS table (some users have access to more than one division, so they have a row int he RLS table for each division they have access to).

 

I have a request from the manager of the group to add an additional filter to restrict access to one account "Cost of Sales" for users who are in 4 of the divisions - "DivC" "DivD" "DivF" and "DivG".  In the Data 1 and Data 2 tables, the columns the account names are named "Account Name" and "Account Description" respectively.

 

I am trying to write a DAX code to add to the filter in Security Roles that will restrict users from those 4 divisions from seeing the account "Cost of Sales" but haven't been able to figure it out.

 

Please let me know if I can supply any additional information.

 

RLS1.JPG

1 ACCEPTED SOLUTION
audreygerred
Super User
Super User

Hi! Row Level Security (RLS) only restricts rows. If you would like to restrict columns and such you will need Object Level Security (OLS) which can be achieved using Tabular Editor 2. Here is a link to explain in much greater detail: Object-level security (OLS) with Power BI - Microsoft Fabric | Microsoft Learn





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

7 REPLIES 7
audreygerred
Super User
Super User

Hi! Row Level Security (RLS) only restricts rows. If you would like to restrict columns and such you will need Object Level Security (OLS) which can be achieved using Tabular Editor 2. Here is a link to explain in much greater detail: Object-level security (OLS) with Power BI - Microsoft Fabric | Microsoft Learn





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you, I'm looking into OLS now.  First time in Tabular Editor, wish me luck.

Here's an alternative to OLS that doesn't break the visual if the user doesn't have access to the column:

Column Level Security - Microsoft Fabric Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you fo rthe additional info - I don't belive I'm restricing any columns, just rows of data ($ soecifically) that don't match the division they are assigned to in the RLS file

Very interesting! Thank you for sharing!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Greg_Deckler
Community Champion
Community Champion

@z-rising Be aware that RLS uses a least restrictive model when it comes to users who fall into multiple roles. Row-level security (RLS) guidance in Power BI Desktop - Power BI | Microsoft Learn



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

That's interesting.  It's been working correctly for me so far in the user access, I haven't had any feedback that anyone can see (or not see) other divisions.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors