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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
breben
Employee
Employee

Resolve issue with username data for RLS

Trying to implement RLS for a report.  The user name data in the data set is only "Firstname Lastname".  Using USERNAME() won't help as it returns the domain\logonname, which the logonname won't be the same data as First Last name.  Same for USERPRINCIPALNAME().  Do I need to create a mapping somewhere of each user's First and Last and tie it to their USERNAME or USERPRINCIPALNAME to make this work? Is there a better way?  thanks   

4 REPLIES 4
parry2k
Super User
Super User

@breben for the xls and it will pass it on to your connected table. You can check RLS-related videos on my channel just to get a basic understanding of where to apply the role



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I'm still struggling on the DAX portion.  The native UserName() and UserPrincipalName() functions won't work since my dataset only has the user's full name (Joe Smith) and neither username or UPN in this scenario contain the full name, only an abbreviation of their full name (jsmith1234@company.com).  I have an XLS where I have defined the user's full name and the related UPN and have created the relationship to the database dataset but still struggling on how to implement this lookup in the report. 

parry2k
Super User
Super User

@breben that is the way to crate the mapping table to make it work, or extract first name and last name from userprincipalname() if email and first, last name use the standard logic.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

OK that's what I figured.  So from the database datasource, the user name is "Joe Smith".  I have created an .XLS for now with two columns, one for the full name and the other for the UPN.  So, "Joe Smith" in the first column and jsmith1234@company.com in the second column. 

 

In PBI I created the relationship between the database and the .XMS, with the full name as the linked field.

 

Now when I create the role in PBI, am I creating the rule for the database source table which has the full name, or am I creating the rule for the .XLS, which is where the mapping data is held?  That's where I am currently confused.     

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.