Power BI

Power BI Row-Level Security (RLS): Static vs Dynamic Approaches

Power BI Row-Level Security (RLS): Static vs Dynamic Approaches

Table of Contents

Introduction

Data is ubiquitous in today’s day and age, and so is the requirement to secure it. Think about creating a stunning Power BI report only to have the wrong individuals view sensitive information. That is where Power BI Row-Level Security (RLS) helps. RLS allows you to control who can access specific data and to what extent.

Whether you’re a business analyst, data professional, or Power BI power user, it’s important to know how to use Power BI Row-Level Security. Therefore, in this article, we’ll take you through the two primary methods, static and dynamic RLS, and give you hands-on examples so you can make it work for your reports.

What is Power BI Row-Level Security (RLS)?

In simple terms, Power BI Row-Level Security restricts the visibility of data according to the user. In contrast to basic access control, which may prevent a user from opening a report altogether, furthermore, RLS allows users to open the report but only view the data they should be able to view.

For instance:

  • A European sales manager should view European sales data.
  • An Asian manager should view Asian sales.

This is implemented in Power BI by establishing roles and filters.

Figure 1: Power BI Row-Level Security in action. Data rows are filtered by users; each user only sees data for their assigned region.
Figure 1: Power BI Row-Level Security in action. Data rows are filtered by users; each user only sees data for their assigned region.

1. Static Row-Level Security (Role-Based Security)

In Static RLS, you define roles, roles determine rules, and you map users to these roles. The rules aren’t dynamic; they are statically hard coded according to your business rules.

When to Use Static RLS

  • Departments that have static access rules.
  • Teams dealing with regional or functional data that’s not changed frequently.
  • Small projects or organizations where things need to be simple.

How to Set Up Static RLS

  • First, open Power BI Desktop and import your dataset.
  • Then go to Modeling → Manage Roles.
Setting Up Static RLS
  • Follow this step-by-step blog to create a new role.
  • Suppose you have a Store table with City Name and Total Sales. To allow a role with access to only York, Erie and Zanesville cities add the following rule in the rules section:

[City Name] IN { “York”, “Erie”, “Zanesville” }

Managing Security Roles
  • After defining the filter condition, click Save to create and apply the Static RLS role.
Static Microsoft Power BI Row-Level Security
Figure 4: The changes are saved successfully; a green bar notification will appear as shown above.
  • To test the roles:
  • Go to Modeling > View as Roles.
  • Then choose the CityFilter(RLS) role we created earlier.
CityFilter(RLS) role
Figure 6: The clustered bar chart displays Total Sales only for the stores located in York, Erie, and Zanesville.
Figure 6: The clustered bar chart displays Total Sales only for the stores located in York, Erie, and Zanesville.

Advantages and Disadvantages of Static RLS

Advantages:

  • It takes less time to implement.
  • Low maintenance for small groups.

Disadvantages:

  • Not adjustable for constant changes.
  • Necessitates manual refreshments whenever user access is modified.

2. Dynamic Row-Level Security (User-Based Security)

What is Dynamic RLS?

Dynamic RLS adapts automatically based on the current logged-in user. It uses DAX functions like USERPRINCIPALNAME() to match the users with their allowed data.

Figure 7: Flowchart showing how the mapping table interacts with USERPRINCIPALNAME().
Figure 7: Flowchart showing how the mapping table interacts with USERPRINCIPALNAME().

When to Use Dynamic RLS

  • Sales teams where each member should see only their assigned region.
  • Large organizations that have many users or whose access changes frequently.
  • Scenarios where manual assignments will be too time-consuming.

How to Apply Dynamic RLS

  1. Create a User Mapping Table.

This table associates each user with the data that they can see.

Example: UserAccess Table

UserEmail  

Region

alice@company.com

Europe

bob@company.com

Asia

charlie@company.com

America

david@company.com

Africa

Configure the Role in Power BI Desktop.

  • Go to Modeling → Manage Roles.
  • Create a role (e.g., DynamicRLS).
  • Select the table you want to secure (e.g., FactSales).
  • Add a filter using your DAX.

[Region] =
LOOKUPVALUE ( UserAccess[Region], UserAccess[UserEmail], USERPRINCIPALNAME () )

Dynamic Power BI Row-Level Security
Figure 8: This tells Power BI: Only return rows where the Region in FactSales matches the Region from UserAccess for the logged-in user.

Testing roles.

  • Go to Modeling > View as Roles.
  • Choose the role we created earlier, you need to check both:
  • The role (e.g., DynamicRLS).
  • The box for Other user, then enter the email.
Modeling > View as Roles
Modeling > View as Roles.
  • View report visuals filtered by that identity.
Figure 11: The image is filtered to display only the records for bob@company.com from the Asia region.
Figure 11: The image is filtered to display only the records for bob@company.com from the Asia region.

Advantages and Disadvantages of Dynamic RLS

Advantages

  • Completely flexible and scalable.
  • Works automatically for everyone.
  • Reduces manual maintenance.

Disadvantages

  • Marginally a more complicated setup.
  • A bit longer to test.

Static vs Dynamic Power BI Row-Level Security (RLS):

Quick Comparison

Feature Static RLS Dynamic RLS
Filter   Fixed per role Based on logged-in user
Maintenance Low High
Flexibility Low   High
User Assignment   Manual Automatic  
Best for Small, fixed teams Large, dynamic organizations

Tips for Implementing Power BI Row-Level Security Successfully

1. Test Roles in Power BI Desktop

Utilize View as Roles to observe how data is visible to various users.

2. Document Everything

Maintain a history of roles, filters, and mapping tables.

3. Maintain Mapping Tables Up to Date

Dynamic RLS relies on correct, up-to-date user information.

4. Prevent Circular References

DAX formulas can be broken if you use tables inappropriately.

5. Supplement with Other Security Features

Implement workspace permissions and dataset security in addition to RLS for complete protection.

Conclusion

Power BI Row-Level Security is not only a security feature; it’s a way to ensure the accuracy of data. Deciding between static and dynamic RLS comes down to your needs:

  • Static RLS: Simple, low-maintenance, ideal for small teams.
  • Dynamic RLS: Adaptive, extensible, ideal for large enterprises.

With the right planning and configuration, Power BI Row-Level Security ensures your data is secure, compliant, and meaningful for every user.

Next Steps:

By using these best practices, your Power BI reports will not only be informative but also secure as well, allowing stakeholders to have trust in the data they’re viewing.

FAQs

Row-Level Security (RLS) limits data access at the row level within Power BI. Rather than everyone viewing the entire dataset, RLS makes users view only those rows they are entitled to see.

Implement Static RLS when your access rules are straightforward, static, and don’t frequently change (e.g., one role by region or department).

Use Dynamic RLS if you have lots of users, constantly shifting access needs, or want a scalable solution (e.g., each salesperson only sees their own customers).

Further Learning and Resources

To learn more about Power BI, check out our course here

ChatGPT Essentials for Data Analytics

Want to learn more about Power BI and how to make reports more efficiently?

  • Power BI training in Australia: We offer comprehensive training sessions across various cities, including Sydney, Melbourne, Brisbane, and Canberra. 
  • Power BI Crash Course eBook: Download our detailed guide to take your Power BI expertise to the next level, covering topics from basics to advanced with practical examples and step-by-step instructions. (Limited time offer)  

Download the Beginner’s Guide to Power BI

Ready to enhance your Power BI skills? Sign up for our training courses and explore our wide range of resources designed to elevate your data analytics capabilities. 

Contact Us: Make an enquiry about our Power BI courses and find the proper training for you. 

We offer comprehensive Power BI training across Australia, tailored to suit different learning styles and proficiency levels. We deliver all our training in collaboration with Dynamic Web Training. 

Leave a Reply

Your email address will not be published. Required fields are marked *