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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Dynamic RLS - multiple email formats for staff

I am setting up Dynamic RLS and planning to use the USERPRINCIPALNAME function. However, staff have emails used in outlook which are different than the emails used to share out reports. I want to confirm that I am choosing the correct email to set up the RLS with.

 

To sign into a Microsoft account and to share the report the email format is user@locationlocal.ca. And the outlook emails are simply user@location.ca . I assume I need to use the user@locationlocal.ca  emails for security.

 

My employee table has a column for each email format. I created the CSW_RLS role, and when testing 'View as' with either email type the data filters correctly if I specify what column to use as principal username. E.g., to filter using the locationlocal.ca email I have [Microsoft Email] = USERPRINCIPALNAME(). To filter using the location.ca email I have [Outlook Email] = USERPRINCIPALNAME(). 

 

How can I be sure which email format to set for the RLS? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @skygold16  ,thanks for the quick reply, you are right.

Hi @Anonymous ,

As  skygold16 said , the USERPRINCIPALNAME() function in Service returns the e-mail address you use to log in to Power BI Service.

vzhouwenmsft_0-1714634285991.png

vzhouwenmsft_1-1714634295345.png

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you both! That is what I assumed. 

Anonymous
Not applicable

Hi @skygold16  ,thanks for the quick reply, you are right.

Hi @Anonymous ,

As  skygold16 said , the USERPRINCIPALNAME() function in Service returns the e-mail address you use to log in to Power BI Service.

vzhouwenmsft_0-1714634285991.png

vzhouwenmsft_1-1714634295345.png

 

skygold16
Helper II
Helper II

Hi, 

 

I think you need to always use the email address which end user will be using to login to Power BI service.

 

Thanks,

Harsh

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.