Row Level Security and Deployment
Row Level Security (RLS) controls which rows of data a user can see in a Power BI semantic model. Deployment is the process of moving approved reporting content through development, testing, and production environments. Together, these practices help organizations protect business data and release reports in a controlled, reliable manner.
Learning Objectives
- Understand the purpose of Row Level Security.
- Differentiate static RLS from dynamic RLS.
- Create basic security roles in Power BI Desktop.
- Test security roles before publishing.
- Understand development, test, and production environments.
- Follow a deployment checklist for reliable report releases.
1. What Is Row Level Security?
Row Level Security restricts the rows returned to a user according to defined security rules. For example, a company may want each regional manager to see sales for their own region while the national manager can see sales for all regions.
RLS applies security filters to data in the semantic model. It does not simply hide a visual or remove a report page. The security rule determines which rows are available to the user when the model is queried.
2. Static Row Level Security
Static RLS uses a predefined filter for each role. For example, one role can filter the Region column to North, while another role filters it to South. The role assigned to the user determines which filter applies.
Example Sales Table
| Region | Salesperson | Sales Amount |
|---|---|---|
| North | Samadhan | 120,000 |
| South | Pradnya | 95,000 |
| East | Samiksha | 80,000 |
| West | Omkar | 110,000 |
If a role has the filter [Region] = "North", a user
assigned to that role sees only the rows that satisfy that condition.
Creating a Static RLS Role
- Open the report in Power BI Desktop.
- Select the Modeling tab.
- Choose Manage roles.
- Create a new role, such as
NorthRegion. - Select the relevant table and define the filter expression.
- Save the role definition.
- Use View as to test the role before publishing.
3. Dynamic Row Level Security
Dynamic RLS uses information about the current user to determine which rows they can access. Instead of creating a separate role for every region or employee, a model can use a user-to-region mapping table and the current user's identity.
A common approach uses USERPRINCIPALNAME() to identify the
signed-in user and a relationship between a security mapping table and
the business data.
Example Security Mapping Table
| User Email | Region |
|---|---|
| north.manager@ciit.example | North |
| south.manager@ciit.example | South |
| east.manager@ciit.example | East |
| west.manager@ciit.example | West |
The email addresses above are illustrative examples. Replace them with the correct identities in your authorized environment.
Example DAX Filter Expression
Suppose the table is named UserRegionAccess and contains
UserEmail and Region columns. A role filter
can match the current user to the mapping table:
UserRegionAccess[UserEmail] = USERPRINCIPALNAME()
This expression filters the mapping table to the current user. For the rule to filter the intended business data, configure the relationships and security-filter propagation correctly. Test the complete model; the expression alone does not guarantee that every related table is secured as intended.
4. Static RLS vs. Dynamic RLS
| Feature | Static RLS | Dynamic RLS |
|---|---|---|
| Security logic | Uses predefined filters for individual roles. | Uses the current user identity and access mapping. |
| Role management | May require several roles for different groups. | Can support many users through a shared role and mapping table. |
| Maintenance | Role definitions may need updates as access requirements change. | Mapping data can be updated as users or assignments change. |
| Best suited for | A small number of stable security groups. | Scenarios where access varies by user or organizational assignment. |
5. Testing RLS Before Publishing
RLS must be tested before the report is released. Incorrect relationships, missing mapping rows, unexpected user identities, or overly broad filters can expose data that should remain restricted.
Testing Checklist
- Open the model in Power BI Desktop.
- Use Modeling and select Manage roles to review the rules.
- Use View as to test each role.
- Check the rows returned in tables and the values shown in visuals.
- Test users who should have access to different regions.
- Check what happens when a user has no matching mapping row.
- Validate relationships and security-filter propagation.
- Publish to a test workspace and verify role assignments in the service.
6. Assigning RLS Users in Power BI Service
After publishing a model that contains RLS roles, users or groups must be assigned to the appropriate roles in Power BI Service where required. Defining a role in Power BI Desktop does not by itself assign every user to that role in the service.
General Assignment Workflow
- Publish the report and semantic model to the intended workspace.
- Open the semantic model's security or role-management settings.
- Select the appropriate RLS role.
- Add the intended users or supported groups.
- Save the role assignments.
- Test with an authorized consumer account.
- Confirm that the user sees only the rows permitted by the role.
7. What Is Power BI Deployment?
Deployment is the controlled process of moving reporting content from development through testing and into production. The goal is to verify changes before they reach business users and reduce the risk of publishing broken reports or incorrect security configurations.
8. Deployment Environments
| Environment | Purpose | Typical Activities |
|---|---|---|
| Development | Build and modify reporting solutions. | Create visuals, measures, relationships, and security rules. |
| Test | Validate the solution before release. | Check calculations, RLS behavior, data connections, and refresh. |
| Production | Provide approved reports to business users. | Monitor report availability, refresh status, permissions, and changes. |
Power BI deployment pipelines can support movement between development, test, and production stages when available and configured for the organization's environment. Other teams may use controlled workspace publishing processes. In either case, validate data connections and security assignments after deployment.
9. Deployment Checklist
Before Release
- Verify report calculations and business totals.
- Confirm that report pages, slicers, and navigation work correctly.
- Test RLS roles and user-to-region mappings.
- Check data source credentials and gateway settings.
- Verify refresh schedule and refresh history.
- Review workspace permissions and app audiences.
- Confirm that production data sources are configured correctly.
- Document the release version and important changes.
After Release
- Open the deployed report and verify key visuals.
- Confirm that intended users can access the content.
- Test security using appropriate consumer accounts.
- Check the first refresh after deployment.
- Monitor user feedback and resolve any release issues.
10. Common RLS and Deployment Problems
| Problem | Possible Cause | Suggested Solution |
|---|---|---|
| A user sees rows from several regions. | The role filter or relationship configuration may be incorrect. | Review the role expression, relationships, and security propagation. |
| A user sees no data. | No mapping row exists, the identity does not match, or the filter is too restrictive. | Verify the signed-in identity, mapping table, and role assignment. |
| RLS works in Desktop but not as expected online. | Service role assignments or the user's access path may differ. | Review service role assignments and test using a consumer account. |
| A deployment introduces incorrect values. | Model changes, data-source configuration, or parameters may differ between environments. | Compare environment settings and validate key measures and data. |
| Users cannot open the production report. | Permissions or app access may not have been configured correctly. | Review production workspace access, app audience, and applicable licensing. |
| Refresh fails after deployment. | Credentials, gateway mapping, or source configuration may be missing. | Verify the production connection settings and run a test refresh. |
11. Practical Exercise
Task: Secure and Deploy a Regional Sales Report
Use a practice dataset and test accounts that you are authorized to manage. Do not use confidential production data for this exercise.
- Create a sales table containing Region, Salesperson, and Sales Amount.
- Create a static RLS role for the North region.
- Use View as to verify that the role filters the data correctly.
- If appropriate, create a user-region mapping table for dynamic RLS.
- Test the dynamic rule with different user identities.
- Publish the report to a development or test workspace.
- Assign the intended users to the relevant roles in the service.
- Verify report access, model permissions, and refresh settings.
- Move the approved content through your available deployment process.
- Verify the deployed report and security behavior after release.
Expected outcome: A regional sales report that displays only permitted rows and follows a documented deployment and validation process.
12. Knowledge Check
Question 1: What does Row Level Security control?
A. The font size of a report
B. Which rows of data a user can access
C. The number of report pages
D. The color of every visual
Question 2: Which function is commonly used in dynamic RLS to identify the current user?
A. SUM()
B. COUNTROWS()
C. USERPRINCIPALNAME()
D. FORMAT()
Question 3: What is the main purpose of a test environment?
A. To skip validation
B. To give every user administrator access
C. To remove all security rules
D. To validate content before production release
Question 4: Does creating an RLS role in Desktop automatically assign all service users to it?
A. Yes, always
B. No, service role assignments may also be required
C. Only on weekends
D. Only when a report has one page
Show Answers
- B — RLS controls which rows a user can access.
- C — USERPRINCIPALNAME() can identify the current user.
- D — The test environment is used to validate content before release.
- B — Assign users or supported groups to the appropriate roles in the service where required.
Summary
Row Level Security restricts which rows users can see in a Power BI semantic model. Static RLS uses predefined role filters, while dynamic RLS can use the current user's identity and an access mapping table. Correct relationships, role assignments, and testing are essential for reliable data protection.
Deployment moves approved reporting content through development, testing, and production environments. Before release, validate calculations, report interactions, RLS behavior, credentials, gateway settings, refresh configuration, and user permissions.
After deployment, confirm that reports work correctly and that users see only the data they are authorized to access. A structured release process and regular security reviews help keep Power BI reports accurate, secure, and reliable.