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.

Reply
Gryphonsclaw
Regular Visitor

Power BI Model View won't filter on Roles

I am trying to model relationships but Power BI won't let me set a one to many because it won't obey the role filtering that's passed in.  It says now view data as the user I have set, but when you look at the relationship preview it isn't.  If it filtered by that role I would have a one to many.  Problem is PowerBI is very limited and I can't pass the user name into the query, so it only projects it in the where clause which makes me have to cross apply security in just to have it filtered out.  

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @Gryphonsclaw ,

 

By default, row-level security filtering uses single-directional filters, regardless of whether the relationships are set to single direction or bi-directional. You can manually enable bi-directional cross-filter with row-level security by selecting the relationship and checking the Apply security filter in both directions checkbox. 

 

This option is only relevant if you have set row-level security in your model.
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 example, I have 2 DIM tables for Employee and Company, and 2 fact tables for EmployeeSalary and Sales.

Company and sales are 1:m relationship, Employee and EmployeeSalary are 1:1 relationship, Company and Employee are 1:m relationship

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

If a bidirection filter is not applied, slicing by company is used for sales and employee salaries.
The result will be that the employee will be able to see not only his salary but also the sales of all companies
If a bidirection filter exists, then the user will only see sales for the company he is tagged in.

 

For more information,you can refer to:How does Row Level Security works when there is a BI-Directional Filter in Power BI/Tabular Model? 

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

View solution in original post

1 REPLY 1
v-tangjie-msft
Community Support
Community Support

Hi @Gryphonsclaw ,

 

By default, row-level security filtering uses single-directional filters, regardless of whether the relationships are set to single direction or bi-directional. You can manually enable bi-directional cross-filter with row-level security by selecting the relationship and checking the Apply security filter in both directions checkbox. 

 

This option is only relevant if you have set row-level security in your model.
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 example, I have 2 DIM tables for Employee and Company, and 2 fact tables for EmployeeSalary and Sales.

Company and sales are 1:m relationship, Employee and EmployeeSalary are 1:1 relationship, Company and Employee are 1:m relationship

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

If a bidirection filter is not applied, slicing by company is used for sales and employee salaries.
The result will be that the employee will be able to see not only his salary but also the sales of all companies
If a bidirection filter exists, then the user will only see sales for the company he is tagged in.

 

For more information,you can refer to:How does Row Level Security works when there is a BI-Directional Filter in Power BI/Tabular Model? 

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.