Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

nandukrishnavs

Dynamic Row Level Security (Dynamic RLS)

Requirement : 

 

We have a table with the User, Customer and Sales value.

 

Sales tableSales table

We need to show the total sales value for each customer. When user login to the report he wanted to see only his customer data.

Sales by CustomerSales by Customer

 

Solution

 

We need to implement RLS.

Click on Modeling Tab and navigate to Manage Roles icon

 

Modeling TabModeling Tab

Then define a role name and right-click on the required table. We are going to use USERPRINCIPALNAME() in the filter condition.

This function returns the name of the user as their email address. 

 

[User] = USERPRINCIPALNAME()

Manage Roles windowManage Roles window

Now we have completed the configuration in the desktop tool. We can test the roles in the desktop itself. 

 

Under the Modeling tab, we have an icon called View as Roles. Click on that icon, we will get a new window.

We have to select both Other user and newly created Role. Then enter the email id of one user in the text box near to the Other user text. 

 

View as rolesView as roles

Click OK and see the changes immediately.

 

Report viewReport viewData viewData view 

Next step is to configure the RLS in app.powerbi.com

 

Go to the dataset tab and follow the below steps.

 

dataset.PNG

 

Click on 3 dots near to the dataset.

 

security.PNG

 

Click on security and you will be navigated to another page. 

 

RLS window.PNG

 

Here you can add all the users to the Member section. You can use either individual email id or group id. 

 

Note: make sure your user does not have edit permission to this report. Otherwise, RLS will not work.

Comments