26.2 Static RLS in Power BI with Example
Quick answer: the short, self-contained version of this lesson is the guide Row-Level Security in Power BI.
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
- Manage roles › create roles Pune, Nashik, Kolhapur with matching filters.
- Publish.
- Service › model › Security › add Ravindra to Pune, Shraddha to Nashik, Zoya to Kolhapur.
- Test as role.
Show the result
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.
Static RLS in Power BI with example — 30 सेकंदात
काय: Static RLS च्या rule मध्ये City = "Pune" सारखी fixed value असते.
का: RLS शिकायचा हा सगळ्यात जलद मार्ग आहे, आणि थोडीच शहरं असतील तेव्हा चालतो.
छोटं उदाहरण: Role Pune → 2 rows, ₹1,200. Role Nashik → 1 row, ₹300.
Static RLS in Power BI with example — 30 सेकंड में
क्या: Static RLS के rule में City = "Pune" जैसी fixed value होती है.
क्यों: RLS सीखने का यह सबसे तेज़ तरीक़ा है, और कम शहर हों तब चलता है.
छोटा उदाहरण: Role Pune → 2 rows, ₹1,200. Role Nashik → 1 row, ₹300.
First look at the data (before → after):
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:
- Click Modeling › Manage roles.
- Click New. Name the role
Pune. - Select table DarkStore.
- Add the rule: City equals Pune. (Or type
[City] = "Pune"in the DAX editor.) - Click Save.
- Click Modeling › View as. Tick Pune. Check ₹1,200.
एक-एक step करून बघा:
- Modeling › Manage roles वर click करा.
- New वर click करा. Role चं नाव
Puneद्या. - Table DarkStore निवडा.
- Rule जोडा: City equals Pune. (किंवा DAX editor मध्ये
[City] = "Pune"type करा.) - Save वर click करा.
- Modeling › View as वर click करा. Pune tick करा. ₹1,200 तपासा.
एक-एक step करके देखिए:
- Modeling › Manage roles पर click कीजिए.
- New पर click कीजिए. Role का नाम
Puneरखिए. - Table DarkStore चुनिए.
- Rule जोड़िए: City equals Pune. (या DAX editor में
[City] = "Pune"type कीजिए.) - Save पर click कीजिए.
- Modeling › View as पर click कीजिए. Pune tick कीजिए. ₹1,200 जाँचिए.
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.
- Modeling › Manage roles.
- Click New and name the role, e.g.
Pune. - Select the table
DarkStoreand 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!
Ravindra Bagale's Tip – मराठी
Static RLS मधली एक common चूक म्हणजे प्रत्येक city साठी एक role बनवणं आणि मग Service मध्ये नवीन users ना योग्य role मध्ये जोडायला विसरणं, त्यामुळे त्यांना काहीच दिसत नाही. कोणत्या group ला कोणता role मिळतो ते लिहून ठेवा, आणि एक-एक user ऐवजी security groups assign करा. ही चूक करू नका!
Ravindra Bagale's Tip – हिंदी
Static RLS की एक common गलती है हर city के लिए एक role बनाना और फिर Service में नए users को सही role में जोड़ना भूल जाना, जिससे उन्हें कुछ नहीं दिखता. लिखकर रखो कि किस group को कौन सा role मिलता है, और अलग-अलग users की जगह security groups assign करो. यह गलती मत करना!
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...
- 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.
- RLS: two cities (Medium): Role filter on Branches: keep rows where City is "Mumbai" or "London". Write it as a TRUE or FALSE column.
- RLS on Product (Medium): Role filter on Loans: keep rows where Product is "Home". Write it as a TRUE or FALSE column.
- RLS: everyone except one country (Hard): Role filter on Branches: keep rows where Country is not "India". TRUE or FALSE column.
- RLS: two tests (Hard): Role filter on Loans: keep rows where Product is "Home" and DaysOverdue is more than 90. TRUE or FALSE column.
- 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.)
- Total Loans (Easy): Measure: Amount Sum = SUM of Amount.
- Recovery Rate (Medium): Shown per Branches Name. Measure: Recovery Rate = SUM of Repaid ÷ SUM of Amount.
- Amount for Home only (Medium): Shown per City. Measure: Amount Home = SUM of Amount where Product is "Home".
- Rows per Branche (Easy): Shown per Branches Name. Measure: Row Count = number of Loans rows.
Revision card
Comparison card