Data & Intelligence

How to Implement Row Level Security in Power BI- Static RLS

Person working on data security

What is RLS? 

RLS is Row Level security means restriction of data accessing for a particular user. Filters restrict the data at a row level. We can configure RLS for a dataset that we have imported into the Power BI desktop and can configure RLS in Power BI Service by defining the roles in the Power BI desktop.

If you have a fixed list of users and a static number of dimensions then the Static RLS method will work.

Data Intelligence - The Future of Big Data
The Future of Big Data

With some guidance, you can craft a data platform that is right for your organization’s needs and gets the most return from your data capital.

Get the Guide

However, if your user list is long and your dimensions are subject to changes then the Dynamic RLS method will work.

Static RLS setup in Power BI

Consider the scenario where you would like to secure the Territories table to one country per user, follow these steps:

  1. Go to the Modeling tab and then select Manage Roles Function.
  2. Create a new role, select the table which you want to get filtered based on the role, and then create a Dax statement to filter this table.                                                                                         Picture1
  3. Once the filters are specified click save.
  4. Now the role is created. test the functionality using View as Function. Picture2
  5. Now select the new role (UnitedStates) that you have created and click OK.                                          Picture3
  6. You are now impersonating the role (notice the yellow warning bar indicating the current role being applied). Picture4
  7. Repeat the above steps for every desired role.
  8. Now the next step is to publish the report to Power BI Service by selecting the Publish function on the home tab and then selecting My workspace.
  9. After the Published report. Open Power BI Service to add members to the role in Power BI service.
  10. Go to your workspace in the Power BI service. Find the dataset that you created with the same name as your report. Click on the ellipsis (…) and then select Security.  Picture5
  11. Next, you will be navigated to the RLS page. On this screen, you can add a member to the role by entering their email address or just the name of the user. When members are added to this role, the DAX filter that you previously defined will be applied to them. If members are not added to the role but have access to the report, RLS will not apply to them. You added the members to the UnitedStates role. Now, when those members sign in, they will only see the report with data that applies to them.     Picture8
  12. To test the roles inside the Power BI service by selecting the ellipsis (…) next to the UnitedStates role on the RLS screen and then selecting Test as the rolePicture6
  13. Now you can see the UnitedStates view that we got earlier in Power BI Desktop.                                Picture7

Summary :

In this blog, I have provided a step-by-step guide on implementing Static Row-level security in Power BI.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Shubham Kapse

Shubham is a technical consultant at Perficient. He has worked with Power BI technology since 2018.

More from this Author

Subscribe to the Weekly Blog Digest:

Sign Up
Follow Us
TwitterLinkedinFacebookYoutubeInstagram