Get startedGet started for free

Row-level security

1. Row-level security

Welcome back! It's time to learn about personalized dashboards using Row-level security.

2. What is row-level security?

Row-level security, also referred to as RLS, can be used to restrict data access for given users, specifically for logged in users. To do so, you can define different roles and rules within Power BI. Thus, a dashboard could look different depending on the person viewing it.

3. What is row-level security?

Row-level security uses filters to restrict data at the row level. To understand, here's an example. The sales table below contains sales for the West and East region.

4. What is row-level security?

If we apply RLS and filter for rows where region is equal to East, the two rows from the West region would be removed.

5. Use cases of row-level security in Power BI

Depending on the size and structure of an organization, RLS has many use cases. You can create user access requirements for specific roles, such as the sales teams. You could, for example, show sales teams different data than the non-sales teams. You can also restrict access requirements for a specific user or group of users. For example, showing the sales teams in Europe data from their respective region, without giving access to sales data of other regions. The final use case is if your stakeholder or customer only wants to see specific data presented. You could, for example, give the general manager access to sales data from all regions. And if you are working on a project for a client you could leave out parts of the data they are not interested in. Let's have a look at a few examples.

6. Use cases of row-level security in Power BI

Here you can see how the dashboard looks for the Switzerland sales teams.

7. Use cases of row-level security in Power BI

You can use RLS so certain users don't have access to any data which causes all graphs to be empty.

8. Use cases of row-level security in Power BI

In the final visualization, we created specific access rights for the general manager, who has access to all data.

9. DAX and row-level security

You might be wondering: What does Row-Level security have to do with DAX? RLS uses DAX to provide filtered values at a row-level. You can write table filter DAX expressions in the "Manage Roles" section in Power BI to filter on fact or dimension tables. Let's assume the database has an [Is Salesperson] column that indicates if a certain employee is a salesperson. From there, you set Is Salesperson equal to true. That way you ensure that only salespeople can have a look at the dashboard.

10. Dynamic row-level security

Using Dynamic Row-level security you can ensure users only see the information appropriate for their roles. The first one is USERPRINCIPALNAME(). This function returns the user principal name or email address. It gives the same result in Power BI Desktop and Power BI service. Power BI service is a tool to create, share, and consume business insights inside an organization. Because it gives the same results regardless of the tool you are using, it is often the preferred method. We'll explain how to use this in the next video. The other function is USERNAME(). This function offers an alternative method to enable RLS with its own use cases, but falls outside the scope of this course. Dynamic row-level security enables you to create custom dashboard for individuals. You can, for example, personalize the dashboard of each individual salesperson. This is a very powerful feature of RLS, and you'll learn how to do this later on.

11. Let's secure it!

Your dashboards will be as secure as a military base before you know it. It's securing time! Enjoy!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.