variable
variable

Reputation: 9714

What is "Apply security filter in both directions" (normal vs security filter)?

I have users dim table with userid, username, useremail

RLS is applied on this table using the username() filter

User dim table connects to sales fact table on userid, so a user can see only his sales.

There is relationship from sales fact table to company dim table on company_id (1 company has many sales, 1:M). On this relationship, I have set cross filter direction to Both, so selecting few sale fact records shows (filters) corresponding company names.

When I made the bidirectional relationship, there is an option called "Apply security filter in both directions". Whether this is checkmarked or not, either ways the filter of selected sale is passed as an filter into the company dim table.

So what is the use of ticking this feature? What is difference between normal filter and security filter?

Upvotes: 1

Views: 10060

Answers (1)

Nandan
Nandan

Reputation: 4945

For a RLS to be effective across multiple instances of Dim table and not explicitly on the one which we created ,we have to explicitly Apply security filter in both directions.

For Eg: Consider I have 2 DIM tables : a) Employee b) Company

And 2 fact tables : a) Employee Salary b) sales

There is 1:m relation among Company and sales and 1:1 relation among Employee and EmployeeSalary and 1:m relation among Company and Employee

Assume the RLS is applied on Employee table based on login .

In case if the bidirection filter is not applied, in case of a slice by company for sales and Employee salary ; the result would be :

  1. for salary , the employee would be able to just see his salary
  2. whereas he would be able to see sales of all companies

In case if the bidirection filter would be present, then the user would be able to see just the sales of the companies he is tagged to.

Hope this clarifies the need of bidirection filter.

The below link would provide detailed explanation :

https://asankap.wordpress.com/2018/05/28/how-does-row-level-security-works-when-there-is-a-bi-directional-filter-in-power-bi-tabular-model/

Upvotes: 3

Related Questions