Diwali Offer!Flat 20% OFF
Enroll Now
PrakalpanaLive online tech training
Data Analytics⏱️ 10 min readπŸ“… Nov 26

Power BI Row-Level Security (RLS): Static and Dynamic RLS Step by Step (2026)

RM
Rohit Malhotraβ€’BI Developer
πŸ“‘ Contents (17 sections)

πŸ“ŒWhat Is Row-Level Security in Power BI?

Row-level security (RLS) restricts which rows of data a user can see in a Power BI semantic model. One report serves everyone, but the South regional manager sees only South, a store manager sees only their store, and a salesperson sees only their own customers.

RLS is defined in the model with DAX filters on tables, grouped into roles. Users and groups are assigned to roles in the Power BI Service.

πŸ“ŒStatic RLS: Step by Step

Static RLS hard codes values in each role.

  • 1In Power BI Desktop, go to Modeling, Manage roles.
  • 2Create a role named South.
  • 3Select the Region table and add the filter:
  • [Region] = "South"

  • 4Repeat for North, East and West.
  • 5Test with Modeling, View as, choose the role, and check every page.
  • 6Publish. In the Service, open the semantic model, Security, and add users or security groups to each role.
  • Static RLS is simple but needs a new role for every new region, so it does not scale well.

    πŸ“ŒDynamic RLS with USERPRINCIPALNAME

    Dynamic RLS uses one role and a security table that maps users to what they can see.

    UserSecurity table

    EmailRegion

    asha@company.comSouth vikram@company.comNorth neha@company.comSouth

    Steps:

  • 1Load the UserSecurity table (from SQL, SharePoint or Excel so the business can maintain it).
  • 2Relate UserSecurity[Region] to Region[Region] (many to one), so the filter flows Region to Sales.
  • 3Create one role, Dynamic, with a filter on UserSecurity:
  • [Email] = USERPRINCIPALNAME ()

  • 4Make sure the filter can flow from UserSecurity to Region. If UserSecurity is on the many side, enable Apply security filter in both directions on that relationship, or design the relationship so Region is filtered by the security table.
  • 5Test with View as, choosing both the role and Other user with an email.
  • 6Publish and add everyone (or an Azure AD / Entra ID group) to the Dynamic role.
  • USERPRINCIPALNAME() returns the signed in user's UPN, usually their work email. Prefer it over USERNAME(), which can return DOMAIN\user in Desktop.

    πŸ“ŒManager Hierarchy RLS

    Managers often need to see their whole team. With an Employee table holding EmployeeID and ManagerID:

    Hierarchy Path = PATH ( Employee[EmployeeID], Employee[ManagerID] )

    Role filter on Employee:

    VAR CurrentEmp =
    LOOKUPVALUE ( Employee[EmployeeID], Employee[Email], USERPRINCIPALNAME () )
    RETURN
    PATHCONTAINS ( Employee[Hierarchy Path], CurrentEmp )

    Each user sees themselves and everyone below them.

    πŸ“ŒUsers Who Should See Everything

    Add an "All" role with no filter (or a filter of TRUE()) for leadership, or handle it in the security table with a flag column checked in the DAX rule.

    πŸ“ŒWho RLS Applies To

    RLS applies to users with Viewer permission on the workspace, and to users who access content through apps or direct sharing. Workspace Admins, Members and Contributors can edit the model and are not restricted by RLS. This is the most common reason "RLS is not working".

    πŸ“ŒRLS with DirectQuery and Live Connections

  • In DirectQuery, RLS filters are pushed into source queries; keep the security table small and indexed.
  • With a live connection to a shared semantic model, RLS defined on that model applies to all thin reports built on it.
  • In Fabric, Direct Lake models support RLS too; check current documentation for any behaviour differences.
  • πŸ“ŒObject-Level Security (OLS)

    OLS hides entire tables or columns, for example a Salary column, from certain roles. Configure it with Tabular Editor on the role, then publish. Visuals that use a hidden column show an error for restricted users, so design reports accordingly.

    πŸ“ŒTesting RLS Properly

  • Use View as in Desktop with multiple roles and users.
  • In the Service, use Test as role on the semantic model security page.
  • Check totals, slicer lists and drill through pages, not just the first visual.
  • Test a user who is in no role; they should see nothing (or get an error) rather than everything.
  • πŸ“ŒCommon RLS Mistakes

  • 1Testing as an Admin and assuming it works.
  • 2Bidirectional relationships everywhere instead of only where security needs it.
  • 3Hard coding emails in DAX instead of a maintained security table.
  • 4Forgetting new joiners: use security groups.
  • 5Using RLS as the only protection for highly sensitive data that should not be in the model at all.
  • 6Slow RLS rules with complex DAX evaluated on large tables.
  • πŸ“ŒFrequently Asked Questions

    What is the difference between static and dynamic RLS?

    Static RLS hard codes a value per role. Dynamic RLS uses one role and a security table with USERPRINCIPALNAME, so it scales to any number of users.

    Does RLS work in Power BI Desktop?

    You define and test it in Desktop with View as. It is enforced for real users in the Power BI Service.

    Can RLS be applied to dashboards?

    Yes. Dashboard tiles and reports built on the secured semantic model respect RLS.

    Is RLS asked in interviews?

    Very often, especially dynamic RLS and "why is RLS not working". See scenario based interview questions.

    Is RLS part of PL-300?

    Yes, under managing and securing Power BI. See the PL-300 guide.

    πŸ“ŒLearn It Live

    Prakalpana's Power BI course covers static, dynamic and hierarchy RLS hands-on, taught live online with an optional 1-on-1 track. See the Power BI learning path, then WhatsApp or call +91 9180377502 for a free demo.

    RM

    Written by

    Rohit Malhotra

    BI Developer

    πŸš€ Master Data Analytics

    Live online + 1-on-1 Power BI training Β· Join 5000+ developers

    Not sure what to do? Book career counselling (β‚Ή200 / 30 min)

    Not sure what to learn next?

    A 1-on-1 session with an industry mentor and a roadmap built for you. How it works

    1. 1Discuss your goals
    2. 2Get a personal plan
    3. 3Start learning
    Book for β‚Ή200/ 30 min