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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

RLS to show certain data based on condition

Hello everyone!

I've been struggling to create a RLS rule that shows a supervisor X data from manager Y. The problem is, I only have supervisor X's e-mail(no data beyond this single e-mail), which it's not even related to manager Y (this one has real data from stores etc), yet I have to show the data somehow. I thought of doing something like if username() = xxxx@xxxx then it should show everything from table stores related to manager Y. Is it even possible to do that? If it is, what DAX should I be using?

Thanks in advance!

1 ACCEPTED SOLUTION
_AAndrade
Super User
Super User

I would use some thing like this:

IF( USERPRINCIPALNAME() = email of the supervisor x, email of manager Y, USERPRINCIPALNAME()

)

 

If you put this measure on the rls table and this table has a relationship to fact table the RLS should bem work as you're looking for.

Let me know if ir works.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

5 REPLIES 5
_AAndrade
Super User
Super User

I would use some thing like this:

IF( USERPRINCIPALNAME() = email of the supervisor x, email of manager Y, USERPRINCIPALNAME()

)

 

If you put this measure on the rls table and this table has a relationship to fact table the RLS should bem work as you're looking for.

Let me know if ir works.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Anonymous
Not applicable

I went along your train of thought and it worked out with this:
RELATED('tb_rls'[login]) = "manageremail" && USERPRINCIPALNAME() = "supervisoremail"

Hi @Anonymous,

Did it solve your problem?
Did my message help you in any way? If it did, please mark my message as the solution and give it a "kudo", I'll appreciate it and help me out





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




_AAndrade
Super User
Super User

In order to provide a right answer it's important to know how your model is working and the tables you are using to implement RLS.
Please provide more information.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Anonymous
Not applicable

I have 4 tables, one fact, 3 dimensions, one has data that will be used for RLS, the other is a calendar and the last one has store characteristcs. I just need to show data from the fact table based on this RLS rule. The problem is, the person that this rule is based of doesn't have any data that relates them to the fact table.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors