Row Level Security in Power BI

The reports created in Power BI can consist of business data that cannot be accessed by all users. For instance, the regional sales manager may need sales data of his or her region, whereas the finance manager may require reviewing financial data of the organization. The row-level security in Power BI will help with the management of such access, allowing the filtering of records that users are allowed to access in the report. 

Thus, businesses can distribute their reports among various departments and maintain access to records according to the roles assigned to them. This blog explains what row-level security is, its types, how to set it up, and how to manage or remove it in Power BI.

What is Row Level Security in Power BI?

Power BI Row Level Security (RLS) is an ability which helps in restricting access of data for users by placing filters on specific rows of semantic models. The filters have been set up with the help of roles and DAX formulae. Once the report has been opened by the user, Power BI places the filters according to their role and shows those records that they can see.

What is Row Level Security in Power BI?

While creating reports for various groups, being able to control who can see certain business data is equally important as presenting data effectively. Power BI consulting services can help with reporting and data governance needs, such as access controls in Power BI.

RLS operates at the row level, which implies that it does not use additional reports created by the report author for every user, but only excludes some data. RLS is set up in the semantic model and compatible with Power BI security connections.

2 Types of Row Level Security in Power BI

Two primary methods are employed for row-level security in Power BI- static RLS and dynamic RLS. While both are similar in terms of restricting user access to certain rows of data, the differences lie in their filtering technique. Which one you should use depends on the number of users with access and the structure of your data.

1. Static Row-Level Security

Static RLS filters data using pre-defined conditions. In static RLS, every role has a fixed filter, so if a user is assigned to any role, he sees those records whose criteria match the DAX formula.

In simple terms, one can assign different roles to the regions of North, South, East, and West in an organization. The following DAX formula will be used to filter the Western region sales:

[Region] = “West”

It is because users that belong to the role will be able to view only those records that have “West” in the Region field.

This technique is very efficient if the organization uses a few user groups whose access can be easily determined. But if the users switch from one department or region to another, changes will have to be made to role assignments or filters manually.

2. Dynamic Row-Level Security

The dynamic RLS identifies what records can be accessed by a particular individual based on his/her identity. Rather than creating distinct roles each one having its own filter for every department or region, there exists a common role where the filters are defined dynamically depending upon the individual signing in.

One popular method for doing so is via the USERPRINCIPALNAME() DAX function, which gets the identity of the user in terms of the User Principal Name (UPN).

[UserEmail] = USERPRINCIPALNAME()

The above expression can be used for a user-mapping table which will have the identity of users and their respective regions. The security filter will then be able to limit access to the sales table through the relationships defined in the database.

Dynamic RLS becomes very handy for enterprises where there are larger groups of people or there are changes to access requirements. The administrator does not need to create individual security roles for every employee.

Static vs. Dynamic Row-Level Security

ComparisonStatic RLSDynamic RLS
Filter methodPredefined conditionsBased on user identity
Role setupSeparate roles for different conditionsCan use a shared role
MaintenanceFilters or assignments may need manual updatesUpdate the user-mapping table
Suitable forSmall, fixed user groupsLarger teams with changing access needs

Both are efficient ways of controlling access to business documents. Static RLS works well if the access requirements remain constant, whereas dynamic RLS is easy to manage where different people require different views of the same set of data.

Row-Level Security in Power BI with Example

Take the case of a company that uses Power BI for sales performance tracking in its regional offices. The sales database held by this company includes data on sales personnel, regions, products, and sales. While it is important for the management team to have an overview of sales data, regional managers need only records of sales in their own regions.

Suppose the company has the following sales records:

SalespersonRegionSales
AliceEast$15,000
BobWest$20,000
CharlieSouth$18,000
AliceEast$17,000
BobWest$21,000

Without RLS, users with access to the report would be able to view all of the data. However, the company can create a security role titled West Region and use the following DAX filter on the Sales table:

[Region] = “West”

When a user assigned to this role opens the report, Power BI applies the filter and displays only the matching records. The resulting view would look like this:

SalespersonRegionSales
BobWest$20,000
BobWest$21,000

A similar method may be used for creating roles for any other region. Another option would be implementing Dynamic RLS based on a user mapping table where each employee sign-on account is mapped to a region.

How to Set Row Level Security in Power BI?

Row-level security in Power BI is configured by creating security roles, setting data filters, and then assigning users to roles. These roles may be created in Power BI Desktop and then user access managed once the semantic model has been published to Power BI Service.

Follow these steps to configure RLS for a report.

Step 1: Open Your Power BI Report

Launch Power BI Desktop, open your desired data set and before setting up any security roles, make sure that the necessary tables and columns are present in the data set and the relationships among the tables are properly set up.

For instance, if you want to limit sales by region, then the data set should have a Region field for identifying the sales.

For more complex data models or security requirements, experienced Power BI developers can help structure relationships, work with DAX filters, and ensure the model supports the required access controls.

Step 2: Create Security Roles

Once your data model is ready:

  1. Open the Modeling tab in Power BI Desktop.
  2. Select Manage Roles.
  3. In the window that opens, select New.
  4. Enter a name for the role, such as West Region.
  5. Select the table where you want to apply the security filter.

Various roles can be created for different geographical locations or departments as per your report requirements.

Step 3: Define the DAX Filter

Once you create the role, then you have to determine the records that members of the role can access.

To limit the role of West Region to accessing sales records in the West region only, enter this DAX code in the filter:

[Region] = “West”

The expression evaluates all the rows based on the condition given. All rows satisfying the condition will be visible to users assigned to this role.

In case of dynamic RLS, one can use identity based expression as below:

[UserEmail] = USERPRINCIPALNAME()

The above statement can be used in the table where the email addresses of users are stored. The table should be related to the sales data in order for the security filter to reach the right records.

When you are done entering the expression, you can validate it and select “Save”.

Step 4: Test the Security Role

Before publishing the report, check whether the filters work as expected.

  1. Go to the Modeling tab.
  2. Select View As.
  3. Choose the role you created.
  4. Select OK to view the report under that role.
  5. Check whether the report displays only the permitted records.

For instance, in evaluating the West Region role, the report must have data for the West region’s sales and not sales from all regions.

Step 5: Publish the Report and Assign Users

Following testing, the report is then published in Power BI Service. The role definitions defined in Power BI Desktop are included as part of publishing the semantic model.

To assign users:

  1. Open the workspace where your semantic model has been published.
  2. Identify the semantic model, then click More Options.
  3. Click on the option of Security.
  4. Identify the role that has been created.
  5. Type the names or e-mail addresses of the users that need to be assigned this role.
  6. Save the changes.

The users allocated with these roles will be shown information depending on the filters set for them, assuming that the semantic model is accessed with role-level security applied.

Note: RLS is for users who have been granted Viewer access to a Power BI workspace. RLS does not apply to users who have been assigned Admin, Member, or Contributor roles within a Power BI workspace. Additionally, users are assigned in the Power BI Service, not in Manage Roles.

How to Use Row Level Security in Power BI?

After setting up the row-level security, it is important to ensure proper management of roles, as well as the way in which the user accesses the report. This can contribute to a situation whereby employees only view records applicable to their responsibilities through one report.

Here are a few ways to use RLS effectively:

1. Assign Users to the Right Roles

Assign roles to users according to their department, region, or responsibility. For instance, regional sales managers must be assigned to roles through which they can see the regional information. You can also apply Microsoft Entra security groups supported by the system instead of assigning permissions to individual users.

2. Keep User Permissions Updated

If the employees switch departments, regions, or responsibilities, check the role assignment of such employees and update the user mapping table in case you apply the dynamic RLS.

3. Test Access After Making Changes

Every time you make changes in DAX filters or in relationship and roles, you need to ensure that the report shows only correct records. In order to test role-based access, Power BI Service has a Test as role feature, which is not available for the models with SSO enabled in DirectQuery mode. Thus, testing should be done using a Viewer account.

4. Check Multiple Role Assignments

It is possible for a single user to have more than one role in the RLS. But in Power BI, such roles’ permissions are additive, if a user belongs to roles for East and West sales, then he/she would have access to all records allowed by those two roles.

These methods make it easier to maintain row-level security amid team and reporting changes.

Related Read: Once access permissions are in place, businesses can also use AI-powered dashboards in Microsoft Power BI to turn authorized business data into more insightful, interactive reports.

How to Remove Row Level Security in Power BI?

In case the access criteria change, it would be necessary to either remove the user from the security role that they are part of or remove the role altogether. Both can be done through Power BI.

Remove a User from an RLS Role

  1. Go to the workspace where you have created the semantic model in Power BI Service.
  2. Click on the More options button (…) beside the semantic model.
  3. Navigate to Security.
  4. Identify the role that has the user listed.
  5. Select the X beside the name of the user.

Delete an RLS Role

  1. Open the report in Power BI Desktop.
  2. Click on Modeling → Manage Roles.
  3. Select the role that you wish to remove.
  4. Press the “Delete” button and confirm the removal.
  5. Publish the report once again in Power BI Service.

Note: Removing a user from a role will not remove the role or the DAX filters that were assigned to that role. Moreover, deletion of a role will result in the deletion of the security settings for that role, so review other role assignments before publishing.

Important Considerations When Using RLS in Power BI

In implementing row-level security in Power BI, a couple of things must be taken into consideration for users to view only what they are authorized to access.

  • Permissions on workspace: RLS is limited to users with the Viewer role on the workspace. Users who have been assigned the Admin, Member, or Contributor roles will not be limited by RLS.
  • Multiple role membership: When a user is part of several RLS roles, the permissions are combined, and the user will be able to view records that are available through at least one of these roles.
  • Table relationships: Security filters flow through active relationships in the data model. The wrong relationships and the wrong direction of the filter might affect the functioning of the RLS.
  • Role testing: Before sharing the reports, make sure you test each role and discover the access problems using the DAX expressions, users, and filtered records.

These checks help avoid any surprises with regard to data exposure and make management of row-level security more flexible.

Row-Level Security in Power BI: Keeping Business Data Secure

The Row-Level Security feature within Power BI allows businesses to have a more realistic means of controlling access to their data without having to create individual reports for each user. No matter which form of row-level security you use, your filters, table relationships, and roles will all need to be set up correctly.

At Aegis Softtech, we also consider data access and security when developing Power BI dashboards. Our Power BI dashboard development services include role-based dashboards and RLS implementation, helping businesses present relevant information to different teams while maintaining appropriate data access.

Frequently Asked Questions

Does row-level security in Power BI work with imported and DirectQuery data?

Yes. RLS is supported by both Import and DirectQuery storage modes. Nonetheless, there may be differences between the query execution process and security application based on the particular data source and connection setting.

Can row-level security in Power BI be applied to multiple tables?

Yes. In RLS, filtering of multiple related tables based on relationships in the semantic model is possible. For instance, the application of a security filter on the Region table may also be able to limit records in a related Sales table.

What is the difference between row-level security and object-level security in Power BI?

RLS decides what rows the user is allowed to view. The OLS, on the other hand, controls the access to a certain table or columns. For instance, RLS can only allow a manager to view sales data from one region, while OLS does not allow the user to view sensitive salary data.

Can users bypass row-level security in Power BI by exporting data?

A user cannot bypass row-level security by exporting the report’s data. Exported data will still be governed by the permissions and security context of the user. The available export options and their limitations depend on the report, the semantic model, and the tenant configurations.

DEVANSHU T.

DEVANSHU T

Senior Tableau Consultant and AI & Data Leader with 8+ years of experience, including 7+ years of hands-on Tableau expertise spanning dashboard design, performance optimisation, data storytelling, and enterprise-scale BI deployments.

Scroll to Top