Ravindra BagaleCourses & study guides मराठी Track your progress

26. Row-Level Security (RLS)

26.2 Static RLS in Power BI with Example

Start with a problem

There are three cities. Ravindra wants one role per city.

Explain simply

Static RLS hard-codes the value in each role's filter ([City] = "Nashik").

Show the data

City Total Sales (₹)
Pune 850
Nashik 800
Kolhapur 450
Total 2,100

About this data: This table uses columns: City, Total Sales (₹). This table uses columns: Role, Member, Total Sales. This table uses columns: Store ID, City. This table uses columns: Role, DAX rule on DarkStore, Total Sales. Values shown are the lesson examples already on this page (not a new dataset).

Fictional sample data. Practice file: rls_user_security.csv, visuals_orders_apr_may_2026.csv (source: src/practice/).

Demonstrate

  1. Manage roles › create roles Pune, Nashik, Kolhapur with matching filters.
  2. Publish.
  3. Service › model › Security › add Ravindra to Pune, Shraddha to Nashik, Zoya to Kolhapur.
  4. Test as role.

Show the result

Static roles per city, sample layout with fictional data

Your result should look like this (fictional sample):

Role Member Total Sales
Pune Ravindra ₹850
Nashik Shraddha ₹800
Kolhapur Zoya ₹450

Explain what happened

Each role filters to one fixed city.

Explore further

  • Static roles grow with cities – see dynamic RLS next.

Detailed reference for this lesson:

Static RLS in Power BI with example — in 30 seconds

What: Static RLS has a fixed value in the rule, like City = "Pune".

Why: It is the quickest way to learn RLS and works when you have only a few cities.

Tiny example: Role Pune → 2 rows, ₹1,200. Role Nashik → 1 row, ₹300.

First look at the data (before → after):

Static RLS in Power BI with example: before and after tables, fictional Blinkit Maharashtra data

Same before / after tables as text

Before — DarkStore

Store ID City
BLK-PUN-01 Pune
BLK-NSK-01 Nashik

Formula / click path

Modeling › Manage roles › New › table DarkStore
Rule: [City] = "Pune"

After — View as each role

Role DAX rule on DarkStore Total Sales
Pune [City] = "Pune" ₹1,200
Nashik [City] = "Nashik" ₹300

Do it step by step:

  1. Click Modeling › Manage roles.
  2. Click New. Name the role Pune.
  3. Select table DarkStore.
  4. Add the rule: City equals Pune. (Or type [City] = "Pune" in the DAX editor.)
  5. Click Save.
  6. Click Modeling › View as. Tick Pune. Check ₹1,200.

What appears on screen after these steps — sample layout, fictional data

What you should see on screen after the steps (sample layout — fictional data, not a Microsoft screenshot).

In static RLS, the filter value is fixed inside the role.

  1. Modeling › Manage roles.
  2. Click New and name the role, e.g. Pune.
  3. Select the table DarkStore and add a rule: City equals Pune. You can also switch to the DAX editor and type:
[City] = "Pune"

Then repeat steps 2–3 for Nashik, Nagpur, Kolhapur, Mumbai and Sambhaji Nagar, and click Save.

A platform-based static role works the same way – for example a role Amazon Now Team with the rule [Platform] = "Amazon Now" on the DarkStore table.

Limitation: you need one role per value. With many cities or hundreds of store managers, static roles become hard to maintain. That is when dynamic RLS helps.

Ravindra Bagale's Tip

A common static RLS mistake is creating one role per city and then forgetting to add new users to the right role in the Service, so they see nothing. Document which role each group gets, and assign security groups rather than individual users. Don't make this mistake!

Fix common mistakes

Wrong result Reason Correction
Role filter typo "pune " Trailing space Match exact values
Salman in two roles sees both Roles combine with OR Expected
No members in Service Not assigned Assign in Security

Practise independently

Practice task

Salman is in Pune and Nashik roles. Total?

Hints
  • 850 + 800.
Solution

₹1,650 (6 rows).

Think like a professional

Static RLS is fine for a few fixed groups; mention its maintenance cost.

Loading DAX practice tasks...

  1. RLS: one country (Easy): Role filter on Branches: keep rows where Country is "India". Write it as a calculated column that gives TRUE or FALSE.
  2. RLS: two cities (Medium): Role filter on Branches: keep rows where City is "Mumbai" or "London". Write it as a TRUE or FALSE column.
  3. RLS on Product (Medium): Role filter on Loans: keep rows where Product is "Home". Write it as a TRUE or FALSE column.
  4. RLS: everyone except one country (Hard): Role filter on Branches: keep rows where Country is not "India". TRUE or FALSE column.
  5. RLS: two tests (Hard): Role filter on Loans: keep rows where Product is "Home" and DaysOverdue is more than 90. TRUE or FALSE column.
  6. What the India role sees (Medium): The India role is on. Measure: Total Loans = SUM of Amount. (Here the role works like a slicer on Country.)
  7. Total Loans (Easy): Measure: Amount Sum = SUM of Amount.
  8. Recovery Rate (Medium): Shown per Branches Name. Measure: Recovery Rate = SUM of Repaid ÷ SUM of Amount.
  9. Amount for Home only (Medium): Shown per City. Measure: Amount Home = SUM of Amount where Product is "Home".
  10. Rows per Branche (Easy): Shown per Branches Name. Measure: Row Count = number of Loans rows.

Ravi Sir's Cards for this lesson

मराठी cards