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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dynamic RLS - keep rows in fact table when either column A or column B matches condition

Hello,

 

I'd like to set up dynamic RLS in a way that rows in the fact table are kept when either 'fact'[Team_assessment] or 'fact'[Team_implementation] matches 'RLS'[Team_coordinator].

 

Table 'fact'

Id_IdeaTeam_assessmentTeam_implementation
1redred
2blueblue
3redblue

 

Table 'RLS'

id_coordinatorEmail_coordinatorTeam_coordinator
11@gmail.comred
22@gmail.comblue
33@gmail.comred

 

Expected Result

id_IdeaTeam_assessmentTeam_implementationis seen by 
1redred1, 3
2blueblue2
3redblue1, 2, 3

 

This would be easy if only 'fact'[Team_assessment] or 'fact'[Team_implementation] had to be filtered by 'RLS', since basic dynamic RLS would be sufficient.

I already created a role 'role 1' Email_coordinator = USERPRINCIPALNAME() and a one column bridge table 'bridge' containing unique values of 'RLS'[Team_Coordinator]. 

 

Could someone provide me a link or a suggestion on how to go about this problem?

Many thanks in advance.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

[Id_Idea] in CALCULATETABLE(VALUES('Table'[Id_Idea]),FILTER(ALL('Table'),'Table'[Team_assessment]=CALCULATE(MAX('Table (2)'[Team_coordinator]),'Table (2)'[Email_coordinator]=USERPRINCIPALNAME())
||'Table'[Team_implementation]=CALCULATE(MAX('Table (2)'[Team_coordinator]),'Table (2)'[Email_coordinator]=USERPRINCIPALNAME())
))

vpollymsft_0-1672367428431.pngvpollymsft_1-1672367443553.png

Best Regards
Community Support Team _ Polly

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

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

[Id_Idea] in CALCULATETABLE(VALUES('Table'[Id_Idea]),FILTER(ALL('Table'),'Table'[Team_assessment]=CALCULATE(MAX('Table (2)'[Team_coordinator]),'Table (2)'[Email_coordinator]=USERPRINCIPALNAME())
||'Table'[Team_implementation]=CALCULATE(MAX('Table (2)'[Team_coordinator]),'Table (2)'[Email_coordinator]=USERPRINCIPALNAME())
))

vpollymsft_0-1672367428431.pngvpollymsft_1-1672367443553.png

Best Regards
Community Support Team _ Polly

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

Anonymous
Not applicable

Hi v-polly-msft

 

This is exactly what I was looking for. Thank you so much.

 

Best regards and many thx

Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

Create a measure.

Measure = 
var cur_user=USERPRINCIPALNAME()
var td=CALCULATE(MAX('Table (2)'[Team_coordinator]),'Table (2)'[Email_coordinator]=cur_user)
var _str=SELECTEDVALUE('Table'[Team_assessment])&SELECTEDVALUE('Table'[Team_implementation])
return
IF(CONTAINSSTRING(_str,td),1)

vpollymsft_0-1672284254125.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

Anonymous
Not applicable

Hi v-polly-msft,

 

Thank you for taking your time and the detailed answer.

 

This workaround using a visual-level filter works perfectly, but only for a table visual. Unfortunately I have lots of measures in my report which are based on the fact table. Is there a way to implement your logic as a table filter dax expression in the Manage Roles tab? 

 

Best regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.