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! Learn more

Reply
VGL321
Regular Visitor

Implementing RLS with 2 Emails columns and filter data- Dynamically

Hi,
when Email 1- apple login he should see the data, same way Email 2 column mentioned users also should see the data of Apple when they login . How implement RLS for these scenario.
what ever the Email 1 user see the data, same way all the users in the Email 2 also should see the same data as Email 1

VGL321_0-1741010488446.png

 

1 ACCEPTED SOLUTION

Hi @VGL321 ,

Based on your earlier error, where the primary email (Email 1) user sees data but users in the Email 2 column do not, it appears your current RLS setup only recognizes the primary email. To resolve this, you can implement RLS using a mapping table that links the primary account (Email 1) with its associated secondary accounts (Email 2).

1. Build a table with two columns

Email 1: Contains the primary account.
Email 2: Lists all the secondary emails that should see the same data. This table essentially​

  maps each secondary email back to its primary account.

2. In your Power BI model, update the RLS rule to check if the logged in user  email via USERPRINCIPALNAME() is found in either the Email 1 or Email 2 column of your mapping table. This change ensures that no matter which email a user logs in with, they’ll always see the same data.

Helpful References:

Row-level security (RLS) with Power BI - Microsoft Fabric | Microsoft Learn

Dynamic Row-Level Security (RLS) Implementation in... - Microsoft Fabric Community

Solved: Row level security with user email - Microsoft Fabric Community

 

 If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.

 

View solution in original post

9 REPLIES 9
V-yubandi-msft
Community Support
Community Support

Hi @VGL321 ,

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

Thank you.

V-yubandi-msft
Community Support
Community Support

Hi @VGL321 ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

V-yubandi-msft
Community Support
Community Support

Hi @VGL321 ,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution we provided for your issue worked for you  or let us know if you need any further assistance?

Your feedback is important to us, Looking forward to your response. 

VGL321
Regular Visitor

@amitchandak Could you please help me in the above mentioned RLS implementation? 

Hi @VGL321 ,

Based on your earlier error, where the primary email (Email 1) user sees data but users in the Email 2 column do not, it appears your current RLS setup only recognizes the primary email. To resolve this, you can implement RLS using a mapping table that links the primary account (Email 1) with its associated secondary accounts (Email 2).

1. Build a table with two columns

Email 1: Contains the primary account.
Email 2: Lists all the secondary emails that should see the same data. This table essentially​

  maps each secondary email back to its primary account.

2. In your Power BI model, update the RLS rule to check if the logged in user  email via USERPRINCIPALNAME() is found in either the Email 1 or Email 2 column of your mapping table. This change ensures that no matter which email a user logs in with, they’ll always see the same data.

Helpful References:

Row-level security (RLS) with Power BI - Microsoft Fabric | Microsoft Learn

Dynamic Row-Level Security (RLS) Implementation in... - Microsoft Fabric Community

Solved: Row level security with user email - Microsoft Fabric Community

 

 If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.

 

bhanu_gautam
Super User
Super User

@VGL321 Create a table that maps each user in "Email 2" to the corresponding user in "Email 1". This can be done in Power BI using the "Enter Data" feature or by importing from a source.

 

Ensure that your main data table has a column for "Email 1". Create a relationship between this column in your main data table and the "Email 1" column in the user mapping table.

 

Go to the "Modeling" tab in Power BI Desktop.
Click on "Manage Roles".
Create a new role and use the following DAX expression to filter the data:

DAX
[Email 1] IN
SELECTCOLUMNS(
FILTER(
'UserMappingTable',
'UserMappingTable'[Email 2] = USERPRINCIPALNAME()
),
"Email 1", 'UserMappingTable'[Email 1]
)

 

Go to the "Modeling" tab.
Click on "View as Roles".
Select the role you created and enter an email from the "Email 2" column to test if the data is filtered correctly

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi @bhanu_gautam thanks for you quick solution

but Email 1 and Email 2 are present in same table only . 
if it is from same table then same DAX which you shared will work ?  Please help

@VGL321 Yes, you can use it like

 

DAX
[Email 1] IN
SELECTCOLUMNS(
FILTER(
'YourTableName',
'YourTableName'[Email 2] = USERPRINCIPALNAME()
),
"Email 1", 'YourTableName'[Email 1]
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






@bhanu_gautam Tired your DAX it is giving blank data. any help please

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