Configuring RLS Roles in Power BI Service
Course: Microsoft Power BI Training
Topic: Configuring Row-Level Security (RLS) Roles in Power BI Service
Course Link: Microsoft Power BI Training
Demo Link: Register for a Course Demo
JustAcademy Website: Visit JustAcademy
1. Introduction to Row-Level Security (RLS)
Row-Level Security (RLS) is a data security feature in Microsoft Power BI that restricts which rows of data a user can view. It allows organizations to share the same report and semantic model with different users while ensuring that each user sees only the information they are authorized to access.
For example, a company may have a sales report containing data for Mumbai, Pune, Delhi, and Bengaluru. The Mumbai sales manager should see only Mumbai sales, while the Pune sales manager should see only Pune sales. RLS makes this possible without requiring separate reports for every manager.
RLS uses roles and filter expressions to control data visibility. You typically define the roles and their rules in Power BI Desktop, publish the semantic model to the Power BI service, assign users or supported groups to the roles, and test the results.
1.1 Learning Objectives
- Understand the meaning and purpose of Row-Level Security.
- Learn the difference between static RLS and dynamic RLS.
- Understand security roles, filters, and user assignments.
- Configure RLS roles in Power BI Desktop.
- Publish a report and semantic model to Power BI service.
- Assign users and security groups to RLS roles.
- Test security roles using the Test as role feature.
- Use DAX functions such as USERPRINCIPALNAME() and USERNAME().
- Identify common RLS configuration problems.
- Apply security best practices in business reporting.
1.2 Why RLS Is Important
- Data confidentiality: Prevents users from viewing rows they are not authorized to access.
- Centralized reporting: Multiple users can work with the same report while seeing different data.
- Reduced report duplication: Avoids maintaining separate reports for every region, department, or manager.
- Improved governance: Supports consistent access policies across business teams.
- Scalability: A well-designed role structure can support many users and departments.
- Controlled self-service analytics: Users can analyze permitted data without automatically receiving access to all underlying rows.
2. Understanding RLS in Power BI
RLS works by applying a filter to one or more tables in a semantic model. The filter determines which rows are visible to a user who is subject to that role. Related tables can also be filtered through model relationships.
2.1 Example of RLS
Suppose a Sales table contains the following data:
| Salesperson |
Region |
Product |
Sales Amount |
| Amit |
Mumbai |
Laptop |
50000 |
| Neha |
Pune |
Monitor |
25000 |
| Rahul |
Mumbai |
Keyboard |
5000 |
| Priya |
Delhi |
Laptop |
60000 |
| Arjun |
Pune |
Mouse |
2000 |
If a role is configured with the following DAX filter, its members see only rows where the Region column is Mumbai.
[Region] = "Mumbai"
The filtered data will be:
| Salesperson |
Region |
Product |
Sales Amount |
| Amit |
Mumbai |
Laptop |
50000 |
| Rahul |
Mumbai |
Keyboard |
5000 |
The filter applies to the rows available through the secured model. Users can still aggregate or analyze the rows they are allowed to access, but the secured rows should not be exposed through another visual or report path.
2.2 Important RLS Concepts
| Concept |
Meaning |
| Role |
A named security configuration containing row-filter rules. |
| Rule |
A DAX expression or supported filter that determines which rows are visible. |
| Role member |
A user or supported security group assigned to a role. |
| Semantic model |
The data model containing tables, relationships, measures, and security definitions. |
| Static RLS |
Uses a fixed filter value, such as Region = Mumbai. |
| Dynamic RLS |
Uses the signed-in user's identity and a mapping table to determine permitted rows. |
| Test as role |
A Power BI service feature for checking how a role filters report data. |
3. Static RLS vs. Dynamic RLS
Power BI supports different approaches to row-level security. The appropriate method depends on the number of users, the complexity of the access rules, and how frequently access assignments change.
3.1 Static RLS
Static RLS uses a fixed condition in a role's filter expression. For example, a role called MumbaiSales might use a filter that allows only Mumbai records.
[Region] = "Mumbai"
Every user assigned to this role sees the same regional data.
Advantages:
- Simple to understand and configure.
- Useful when a small number of fixed regions or departments need separate access.
- Easy to validate because each role has a predictable filter.
Limitations:
- Many regions may require many roles.
- Changes to access rules can require changes to role definitions.
- Role maintenance becomes harder when user counts grow.
3.2 Dynamic RLS
Dynamic RLS determines which data a user can see based on the user's identity. A common approach uses USERPRINCIPALNAME() to identify the signed-in user and a user-mapping table to associate that user with one or more permitted regions.
For example, the mapping table might contain:
With a correctly configured relationship and DAX filter, Amit can see Mumbai data, Neha can see Pune data, and the manager can see both Mumbai and Pune data.
Advantages:
- Supports many users with fewer role definitions.
- Allows access assignments to be managed through a mapping table.
- Can support users who are authorized for multiple regions.
Limitations:
- Requires correct relationships and user identity values.
- Incorrect mapping data can cause missing or excessive access.
- Must be tested carefully after publishing.
3.3 Comparison of Static and Dynamic RLS
| Feature |
Static RLS |
Dynamic RLS |
| Filter method |
Fixed DAX condition |
User identity and mapping logic |
| Role count |
May increase with regions or departments |
Can use a shared dynamic role |
| User management |
Assign users to relevant fixed roles |
Update user-to-data mapping and assign users to the dynamic role |
| Best suited for |
Small, stable access structures |
Large or frequently changing user populations |
| Complexity |
Usually simpler initially |
Requires careful model and identity design |
4. Understanding RLS Roles in Power BI Service
Power BI Desktop is generally used to define RLS roles and their filter expressions. After publishing, the Power BI service allows authorized users to assign people or supported groups to those existing roles and test how the filters behave.
4.1 What Is an RLS Role?
An RLS role is a named set of row-filter rules. For example, an organization may create the roles MumbaiSales, PuneSales, and DelhiSales. Each role contains a rule that filters the sales data to the relevant region.
4.2 Why Are Roles Required?
- They define which rows are permitted for a user.
- They separate access rules from individual report visuals.
- They allow users with similar access requirements to share one security configuration.
- They support consistent enforcement of data filters throughout a secured semantic model.
4.3 Where Are Roles Managed?
| Task |
Typical Location |
| Create a role |
Power BI Desktop, Modeling > Manage roles |
| Write or edit the filter expression |
Power BI Desktop role editor |
| Publish the model |
Power BI Desktop to Power BI service |
| Assign users to existing roles |
Power BI service, semantic model Security page |
| Test a role |
Power BI service, Test as role |
The exact menu labels can vary slightly with Power BI interface updates and workspace configuration.
5. Prerequisites for Configuring RLS
Before configuring RLS roles in Power BI service, prepare the semantic model and verify that the people managing security have the required permissions.
5.1 Technical Prerequisites
- A Power BI Desktop report with a semantic model.
- A suitable table and column for filtering rows.
- Correct table relationships when filters must propagate across tables.
- RLS roles defined in the model before assigning members in the service.
- A published semantic model and report in a Power BI workspace.
- Valid data-source credentials and gateway configuration when required.
5.2 Access Prerequisites
- Permission to publish or update the semantic model.
- Appropriate permissions to manage semantic model security.
- Access to the relevant workspace and semantic model.
- Correct user email addresses or supported group identities.
5.3 Important Workspace Role Limitation
RLS applies to users accessing the semantic model as viewers, including users who have been granted Build permission but remain subject to RLS. It does not restrict workspace users with Admin, Member, or Contributor roles in the same way, because these workspace roles have edit permissions.
If a person must be restricted by RLS, do not grant them workspace Admin, Member, or Contributor access to the workspace containing the model. Use the Viewer workspace role or an appropriate content-sharing approach, and separately verify all permissions and sharing paths.
6. Creating RLS Roles in Power BI Desktop
Before adding users to roles in Power BI service, define the required roles and filters in Power BI Desktop.
6.1 Step-by-Step Instructions
- Open the Power BI Desktop report.
- Confirm that the required tables and relationships are present.
- Select the Modeling tab.
- Select Manage roles.
- Select New to create a role.
- Enter a meaningful role name, such as MumbaiSales.
- Select the table to which the security filter should apply.
- Enter the required filter condition in the role editor.
- Use the DAX editor when the rule requires expressions such as USERPRINCIPALNAME().
- Validate the expression and save the role.
- Repeat the process for any additional static roles.
- Use the Desktop role-testing feature to check the result before publishing.
6.2 Example: Creating a MumbaiSales Role
Suppose the Sales table contains a Region column. Create a role called MumbaiSales and apply this expression to the Sales table:
[Region] = "Mumbai"
Only rows where Region equals Mumbai will be available to users assigned to this role, subject to the model's relationships and other security filters.
6.3 Example: Creating a PuneSales Role
[Region] = "Pune"
This role filters the Sales table to Pune records.
6.4 Naming Best Practices
- Use clear, descriptive role names.
- Use a consistent naming convention, such as Region_Mumbai or Department_Finance.
- Avoid ambiguous names such as Role1 or TestRole in production models.
- Avoid commas in role names because Power BI role names cannot contain commas.
- Document the purpose and expected access for each role.
7. Publishing the Model to Power BI Service
Once the roles have been defined and tested in Power BI Desktop, publish the report and semantic model to the Power BI service.
7.1 Publishing Steps
- Save the Power BI Desktop file.
- Review the report and ensure the intended RLS roles are saved.
- Select Home > Publish.
- Sign in with the appropriate organizational account if prompted.
- Select the destination workspace.
- Wait for publishing to finish.
- Open the Power BI service in your browser.
- Navigate to the selected workspace.
- Locate the published semantic model and report.
- Confirm that the model is available and that its data-source credentials and refresh settings are configured when needed.
7.2 What Happens During Publishing?
- The report and semantic model are published to the selected workspace.
- The RLS role definitions are included in the published model.
- The users assigned to those roles are managed separately in the Power BI service.
- Publishing does not automatically assign all intended users to their roles.
Important: If you modify role definitions in Power BI Desktop and republish the model, review the role assignments and security behavior in the service after publishing.
8. Configuring RLS Role Membership in Power BI Service
After publishing the model with roles defined, use the Power BI service to assign users or supported groups to those roles.
8.1 Step-by-Step Instructions
- Sign in to the Power BI service with your organizational account.
- Open the workspace containing the published semantic model.
- Locate the semantic model, not just the report.
- Select the More options (...) menu next to the semantic model.
- Select Security.
- Open the Row-Level Security page.
- Select the role you want to manage, such as MumbaiSales.
- Enter the user's name or email address, or the name of a supported security group.
- Select the matching identity from the available suggestions.
- Add the member to the role.
- Repeat for other users and roles as required.
- Review the membership list and verify that the correct people are assigned.
8.2 Example of Role Membership
The AllRegionsManager example requires a rule that actually grants the intended regions. A role's name alone does not grant access to all regions.
8.3 Supported Members and Groups
Power BI service supports assigning individual users and certain group types to RLS roles, including supported Microsoft Entra security groups, distribution groups, and mail-enabled groups.
- Individual organizational users can be assigned directly.
- Supported Microsoft Entra security groups can simplify administration.
- Distribution groups and mail-enabled groups may be used where supported.
- Microsoft 365 groups are not supported for RLS role membership.
- Power BI-created groups cannot be added as RLS members.
For external B2B guest users, verify that the user's identity and group membership are resolved correctly. In some scenarios, assigning the guest directly by email to the role is more reliable than relying on security-group membership.
8.4 Removing a User from a Role
- Open the semantic model's Security page.
- Select the role from which the user must be removed.
- Find the user's identity in the membership list.
- Select the remove control next to the member.
- Confirm the membership list no longer contains that user.
- Test the user's access to confirm that the intended security change has taken effect.
9. Understanding DAX Filters for RLS
DAX filter expressions determine which rows are visible to a role. The expression is evaluated as a condition for the rows of the table on which the rule is defined.
9.1 Static Filter by Region
[Region] = "Mumbai"
This expression allows rows whose Region value is Mumbai.
9.2 Filter by Department
[Department] = "Finance"
This expression allows rows belonging to the Finance department.
9.3 Filter by a Numeric Condition
[SalesAmount] >= 10000
This expression allows rows where SalesAmount is at least 10,000. This is an example of a row filter, not a replacement for a complete business security policy.
9.4 Combine Multiple Conditions
[Region] = "Mumbai"
&& [SalesAmount] > 10000
This expression allows rows where the region is Mumbai and the sales amount is greater than 10,000.
9.5 Use OR Conditions
[Region] = "Mumbai"
|| [Region] = "Pune"
This expression allows rows from either Mumbai or Pune.
9.6 Common DAX Operators
| Operator |
Purpose |
Example |
| = |
Equals |
[Region] = "Mumbai" |
| <> |
Not equal to |
[Status] <> "Cancelled" |
| && |
Logical AND |
[Region] = "Mumbai" && [Year] = 2026 |
| || |
Logical OR |
[Region] = "Mumbai" || [Region] = "Pune" |
| > |
Greater than |
[SalesAmount] > 10000 |
| >= |
Greater than or equal to |
[SalesAmount] >= 10000 |
10. Configuring Dynamic RLS with USERPRINCIPALNAME()
Dynamic RLS is useful when users need different data based on their signed-in identity. Rather than creating a separate role for every person, you can use a user-mapping table and a DAX rule that matches the current user's identity.
10.1 What Is USERPRINCIPALNAME()?
USERPRINCIPALNAME() returns the current user's User Principal Name (UPN). In the Power BI service, this commonly resembles an email address, such as [email protected].
USERPRINCIPALNAME()
The exact identity format should be verified in the target environment, particularly when external guest users or embedded scenarios are involved.
10.2 Create a User-Mapping Table
Create a table named UserRegionAccess with the following columns:
10.3 Create Model Relationships
A common design uses a Region dimension table related to the Sales table and a UserRegionAccess mapping table related to the Region dimension. The relationship directions and security propagation must be designed and tested carefully.
One possible model is:
UserRegionAccess
|
| Region key
v
DimRegion
|
| Region key
v
Sales
The model must ensure that the current user's permitted regions filter the Sales table. Do not assume that a relationship automatically propagates RLS in every model; inspect the relationship directions and the model's security-filter behavior.
10.4 Create a Dynamic Role
In Power BI Desktop, create a role called DynamicRegionAccess and apply this DAX expression to the UserRegionAccess table:
[UserEmail] = USERPRINCIPALNAME()
This expression filters the mapping table to the signed-in user. With suitable relationships and security propagation, the permitted regions then filter the Sales table.
10.5 Assign Users to the Dynamic Role
- Save and publish the semantic model with the dynamic role defined.
- Open the model's Security page in Power BI service.
- Add the intended users or supported group to DynamicRegionAccess.
- Ensure the mapping table contains the correct identity values and permitted regions.
- Test each user to confirm that only the expected rows are available.
Important: Dynamic RLS does not automatically assign a user to a role. The user must still have appropriate access to the content and be assigned to the dynamic role, directly or through a supported group.
11. Understanding USERNAME() vs. USERPRINCIPALNAME()
Both functions can be used in dynamic security designs, but they do not necessarily return the same text format in every environment.
| Function |
Purpose |
Important Consideration |
| USERPRINCIPALNAME() |
Returns the current user's UPN |
Often resembles an email address in the Power BI service |
| USERNAME() |
Returns a username or identity value |
In Power BI Desktop it can appear as DOMAIN\username, while in the service it commonly resolves to a UPN |
For many user-mapping implementations in the Power BI service, USERPRINCIPALNAME() is a practical choice. Always verify the returned identity before relying on it for access decisions.
11.1 Example Using USERNAME()
[UserLogin] = USERNAME()
This example assumes that the UserLogin column stores values matching the identity returned by USERNAME() in the environment where the model runs.
11.2 Test the Current Identity
You can create a temporary measure to display the identity returned by the function:
Current User = USERPRINCIPALNAME()
Place the measure in a card visual during testing. Remove or retain the diagnostic visual according to your report design and security requirements.
12. Testing RLS Roles in Power BI Service
Testing is essential because an incorrectly configured RLS rule can either hide data that a user needs or expose data that should remain restricted.
12.1 Using Test as Role
- Open the workspace containing the semantic model.
- Locate the semantic model and open its More options menu.
- Select Security.
- Find the role you want to validate.
- Select the role's More options menu.
- Select Test as role.
- Review the report that opens in the role-testing view.
- Verify that the displayed rows match the role's filter expression.
- Use the available identity options to test a specific user or another role when supported.
- Return to the security page when testing is complete.
12.2 What to Check During Testing
- Only the expected regions or departments appear.
- Card totals and chart values reflect the filtered dataset.
- Table visuals do not reveal restricted records.
- Slicers and drill-through pages respect the same security boundaries.
- Dynamic RLS maps the selected user to the correct rows.
- Users with access to multiple permitted regions see the intended union of those regions.
- Unauthorized users do not see data through alternate reports connected to the same secured model.
12.3 Testing Limitations
Test as role does not validate every report feature or authentication scenario. For example, it is not supported for DirectQuery semantic models with single sign-on (SSO) enabled. Some visual experiences also cannot be fully validated through the feature. In these cases, test using an actual account with the intended permissions and authentication path.
13. Understanding How RLS Works with Workspace Permissions
RLS and workspace roles control different aspects of access. RLS restricts rows in a semantic model, while workspace roles determine what a user can do within the workspace.
| Workspace Role |
Typical Permission Level |
RLS Behavior |
| Admin |
Full workspace management |
RLS does not restrict the user in the same way it restricts viewers |
| Member |
Can publish and manage workspace content |
RLS does not restrict the user in the same way it restricts viewers |
| Contributor |
Can create and edit content |
RLS does not restrict the user in the same way it restricts viewers |
| Viewer |
Can view workspace content |
RLS applies to the semantic model when configured for the user |
Best practice: Give report consumers the minimum workspace and semantic model permissions they need. If RLS must restrict their rows, avoid granting them workspace Admin, Member, or Contributor roles in the workspace that contains the secured model.
14. RLS with Multiple Roles
A user can belong to more than one RLS role. Power BI combines the row access allowed by the assigned roles additively, meaning the user can see the union of rows allowed by those roles.
14.1 Example
Suppose a user belongs to both MumbaiSales and PuneSales:
Role 1: [Region] = "Mumbai"
Role 2: [Region] = "Pune"
The user may see records from both Mumbai and Pune because the permissions granted by the roles are additive.
14.2 Why Multiple Role Membership Requires Care
- A user might receive broader access than intended.
- A restrictive rule in one role does not necessarily cancel access granted by another role.
- Users may receive roles indirectly through security-group membership.
- Role combinations should be tested, not just each role individually.
Whenever possible, design roles so that each user receives the intended combined permissions without relying on contradictory filters.
15. RLS and Table Relationships
Power BI relationships determine how filters propagate through the semantic model. A role applied to a dimension table can restrict a related fact table when the model's relationships support the required filtering behavior.
15.1 Example Star Schema
DimRegion
|
| One-to-many relationship
v
Sales
If DimRegion is filtered to Mumbai and the relationship propagates the filter to Sales, the report can show only sales associated with Mumbai.
15.2 Relationship Best Practices
- Use clear dimension and fact table structures.
- Confirm the correct relationship keys.
- Check relationship cardinality and filter direction.
- Test whether security filters propagate as intended.
- Avoid enabling bidirectional security filtering unless required and fully tested.
- Review the impact of security filtering on performance.
15.3 Bidirectional Security Filtering
Power BI normally applies RLS filtering using the model's supported security-filter behavior. In specific designs, a relationship can be configured to apply security filtering in both directions. This can help with some dynamic security models but may affect query performance or create ambiguous filter paths.
Use bidirectional security filtering only when necessary, and test the model for correct access boundaries and performance.
16. Common RLS Configuration Errors and Solutions
16.1 The Security Option Is Missing
Possible cause: The semantic model has no RLS roles defined, the selected item is a report rather than a semantic model, or the current account lacks the required permissions.
Solution: Confirm that roles were created in Power BI Desktop and published. Open the semantic model's More options menu and check the account's permissions.
16.2 A User Sees All Data
Possible cause: The user may not be assigned to the intended role, may have broader access through another role, or may have a workspace Admin, Member, or Contributor role.
Solution: Review role membership, workspace permissions, group memberships, and the DAX filter. Test with an account that has only the intended consumer permissions.
16.3 A User Sees No Data
Possible cause: The user's identity does not match the mapping table, the filter expression returns no matching rows, or the relationships do not propagate the filter correctly.
Solution: Check USERPRINCIPALNAME(), verify email addresses and mapping values, inspect relationships, and test the role in the service.
16.4 Dynamic RLS Works in Desktop but Fails in Service
Possible cause: The identity format differs between Desktop and service, or the user has not been assigned to the dynamic role.
Solution: Verify the UPN returned in the service, update the mapping table if required, assign the user to the role, and test the published model.
16.5 A User Can See More Data Than Expected
Possible cause: The user belongs to multiple roles, has inherited access through a security group, or has elevated workspace permissions.
Solution: Audit direct and group-based membership, simplify the role design, and test the combined result. Remember that RLS role filters are additive.
16.6 Security Filters Do Not Reach the Fact Table
Possible cause: Relationships are missing, inactive, incorrectly keyed, or unable to propagate the security filter as expected.
Solution: Inspect the model diagram, validate relationships, and test the security behavior across dimension and fact tables.
16.7 External Guest User Sees Incorrect Data
Possible cause: The identity returned for a guest user differs from the email value stored in the mapping table, or group membership is not resolved as expected.
Solution: Validate the guest's actual UPN in the target environment and consider assigning the guest directly to the role when appropriate. Test the actual guest account rather than relying only on an internal-user test.
16.8 RLS Does Not Restrict Columns
Possible cause: RLS is designed to filter rows, not to hide individual columns or measures.
Solution: If column or object-level access must differ by user, investigate Object-Level Security (OLS) and other supported model-security options instead of relying on RLS alone.
17. Security Best Practices for RLS
- Follow least privilege: Give each user only the access required for their job.
- Use dynamic RLS where appropriate: A user-mapping table can simplify access management for large organizations.
- Use supported security groups: Group-based assignment can simplify membership maintenance when the group type and scenario are supported.
- Audit role memberships: Review users, groups, and inherited access regularly.
- Test combined role access: Remember that users assigned to multiple roles can receive the union of the roles' permissions.
- Protect the workspace: Avoid elevated workspace permissions for people who must be restricted by RLS.
- Validate relationships: Confirm that security filters reach the appropriate fact tables.
- Test using real accounts: Verify actual consumer permissions and identity values before release.
- Document role rules: Record what each role permits and who owns its membership.
- Monitor changes: Re-test security after modifying the model, relationships, role definitions, or user mapping table.
- Use OLS when needed: RLS does not provide column-level or table-object hiding.
- Review external access: Test guest users and embedded access paths separately when they are part of the solution.
18. Practical Project: Regional Sales Security
This project demonstrates how to configure and test regional access for a sales report in Power BI.
18.1 Project Objective
Create a sales report where Mumbai, Pune, and Delhi managers can see only their own region's records.
18.2 Sample Sales Table
| SalesID |
Salesperson |
Region |
Product |
SalesAmount |
| 101 |
Amit |
Mumbai |
Laptop |
50000 |
| 102 |
Neha |
Pune |
Monitor |
25000 |
| 103 |
Rahul |
Mumbai |
Keyboard |
5000 |
| 104 |
Priya |
Delhi |
Laptop |
60000 |
| 105 |
Arjun |
Pune |
Mouse |
2000 |
18.3 Create the Roles
Create three roles in Power BI Desktop.
Role 1: MumbaiSales
[Region] = "Mumbai"
Role 2: PuneSales
[Region] = "Pune"
Role 3: DelhiSales
[Region] = "Delhi"
18.4 Publish and Assign Users
- Save the Power BI Desktop file.
- Publish it to the target workspace.
- Open the semantic model's Security page.
- Add the Mumbai manager to MumbaiSales.
- Add the Pune manager to PuneSales.
- Add the Delhi manager to DelhiSales.
- Review the membership list.
18.5 Create Report Visuals
- Card visual showing total sales.
- Bar chart showing sales by product.
- Table showing individual transactions.
- Column chart comparing sales by salesperson.
- Slicer for order date, if the dataset contains a date column.
18.6 Test Expected Results
| Test User |
Expected Visible Regions |
Expected Result |
| Mumbai manager |
Mumbai |
Only Mumbai transactions appear |
| Pune manager |
Pune |
Only Pune transactions appear |
| Delhi manager |
Delhi |
Only Delhi transactions appear |
| Unauthorized consumer |
None unless explicitly granted access |
Cannot access the report or see protected data without appropriate permissions |
18.7 Project Completion Checklist
- All three roles have been defined and saved.
- The report and semantic model have been published.
- Correct users have been assigned to each role.
- Workspace permissions have been reviewed.
- Test as role results match the intended regional access.
- Role combinations and group memberships have been checked.
- The project documentation describes the access rules.
19. RLS vs. Object-Level Security (OLS)
RLS and OLS solve different security problems. RLS restricts rows, while OLS can restrict access to specific tables or columns in supported semantic-model scenarios.
| Feature |
RLS |
OLS |
| Main purpose |
Restricts rows of data |
Restricts access to model objects such as tables or columns |
| Example |
A regional manager sees only Mumbai sales |
A user cannot access a protected salary column |
| Common implementation |
Role filters using DAX expressions |
Object-level permissions through supported model-security tools |
| Use together |
Can be combined with OLS in supported designs |
Can complement RLS when both row and object restrictions are required |
Do not use hidden columns, hidden tables, report filters, or slicers as substitutes for security. Hiding a field from the report interface does not provide the same protection as a properly configured security mechanism.
20. Interview Questions and Answers
Q1. What is Row-Level Security in Power BI?
Answer: RLS restricts which rows of a semantic model a user can view by applying role-based filter expressions.
Q2. Where are RLS roles created?
Answer: For typical imported or DirectQuery semantic models, roles are created in Power BI Desktop using Modeling > Manage roles and then published with the model.
Q3. Where are users assigned to RLS roles?
Answer: Users and supported groups are assigned to existing roles from the Security page of the semantic model in Power BI service.
Q4. What is static RLS?
Answer: Static RLS uses a fixed filter, such as [Region] = "Mumbai", so all members of the role see the same permitted region.
Q5. What is dynamic RLS?
Answer: Dynamic RLS uses the signed-in user's identity and a mapping table to determine which rows that user can access.
Q6. What does USERPRINCIPALNAME() do?
Answer: It returns the current user's UPN, which commonly resembles an email address in the Power BI service.
Q7. Does publishing automatically assign users to roles?
Answer: No. Publishing sends the role definitions with the model, but role membership must be managed separately in the Power BI service.
Q8. What is the Test as role feature?
Answer: It lets authorized users validate how a role filters a report in the Power BI service.
Q9. Does RLS apply to workspace Admins, Members, and Contributors?
Answer: RLS does not restrict these workspace roles in the same way it restricts viewers. Users who must be subject to RLS should not receive elevated workspace roles for the secured model.
Q10. Can one user belong to multiple RLS roles?
Answer: Yes. Role filters are additive, so the user can see the union of the rows permitted by their assigned roles.
Q11. Can RLS hide a column?
Answer: No. RLS restricts rows. Object-Level Security or another appropriate security mechanism is needed to restrict access to model objects.
Q12. Why might dynamic RLS return no data?
Answer: The identity might not match the mapping table, the user might not be assigned to the role, or the relationships may not propagate security filters correctly.
Q13. Can groups be assigned to RLS roles?
Answer: Yes, supported Microsoft Entra security groups, distribution groups, and mail-enabled groups can be used. Microsoft 365 groups and Power BI-created groups are not supported as RLS role members.
Q14. Can RLS be used with DirectQuery?
Answer: Yes, RLS can be used with supported DirectQuery semantic models. However, testing and behavior depend on the data source and authentication configuration.
Q15. How should RLS be tested before deployment?
Answer: Test each role and relevant role combination, validate the filtered rows and measures, verify workspace permissions, and use actual consumer accounts when needed.
21. Hands-On Exercises
- Create a Power BI report with a Sales table containing Region, Product, and SalesAmount.
- Create static RLS roles for Mumbai, Pune, and Delhi.
- Publish the report and semantic model to Power BI service.
- Assign three test users to the corresponding roles.
- Use Test as role to verify the visible rows for each role.
- Create a user-mapping table for dynamic RLS.
- Use USERPRINCIPALNAME() to filter the mapping table.
- Configure relationships so that permitted regions filter the Sales table.
- Test a user assigned to multiple permitted regions.
- Review the effect of workspace Admin, Member, Contributor, and Viewer permissions.
- Test an invalid email address in the mapping table and document the result.
- Prepare a security checklist for deployment.
22. Quick Revision Notes
- RLS stands for Row-Level Security.
- RLS restricts which rows of a semantic model users can view.
- Roles and filter rules are typically defined in Power BI Desktop.
- Role membership is managed in Power BI service.
- Static RLS uses fixed conditions such as [Region] = "Mumbai".
- Dynamic RLS commonly uses USERPRINCIPALNAME() with a mapping table.
- RLS rules must be supported by correctly designed relationships.
- Publishing a model does not automatically assign users to roles.
- Test as role helps validate the filtering behavior.
- Workspace Admin, Member, and Contributor roles are not restricted by RLS in the same way as viewers.
- Multiple role assignments are additive and can expand the rows a user sees.
- RLS does not hide individual columns; consider OLS when required.
- Use least-privilege access and verify all security paths before deployment.
23. Official Learning Resources
24. Conclusion
Configuring RLS roles in Power BI service is an important part of protecting business data while allowing users to work with shared reports. The process involves creating suitable roles and filter rules in Power BI Desktop, publishing the model, assigning users or supported groups in the Power BI service, and validating the result.
Static RLS is suitable for simple, fixed access requirements, while dynamic RLS can simplify security management for larger organizations by using user identities and mapping tables. Both approaches require careful attention to relationships, role membership, workspace permissions, and testing.
By following least-privilege principles, testing actual user access, and reviewing security after model changes, Power BI developers can build reports that support controlled, reliable, and scalable business analytics.