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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Row Level Security

Hi,

 

I am trying to implement Row Level Security, based on the Column "User Access". But the challenge is that the column might have two users seperated by a delimiter (in this case $). I tried using contains keeping in mind that if the "User Access" column contains userpinciplename the record should populate. But it seems that it's not working that way. Below is the dataset and the measures I have used. Also attached the scren shot of the dashboard.

 

Order DateLast Ship DateExpected Ship DateValueUser Access
01-01-201801-01-201801-02-20181 
01-05-201902-06-201901-02-20182ABC@XYZ.com
02-06-201901-10-201901-02-20183ABC@XYZ.com
01-07-201901-10-201901-02-20184ABC@XYZ.com
01-08-201901-10-201901-03-20185ABC@XYZ.com # XYZ@XYZ.com
01-09-201901-10-201901-03-20186 
01-10-201901-10-201901-04-20187 
01-11-201901-11-201901-03-20188 
01-12-201901-01-202001-03-20189 

 

Measures Used:

 

CurrentUPN = USERPRINCIPALNAME()
 
IsCurrentUPN =
IF (
CONTAINS (Sheet1,Sheet1[User Access],[CurrentUPN]),
TRUE(),
FALSE()
)
 
Sample.png
 
Does anyone have a solution/alternative for this?
 
Thanks
1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @Anonymous , 

 

just use this DAX expression in the manage role section:

containsstring('<your tablename>'[user access] , userprincipalname())

Please be aware that the USERPRINCIPALNAME() and USERNAME() might return different results on Power BI Desktop and in Power BI Service.

 

Hopefullly this is what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

Hey @Anonymous , 

 

just use this DAX expression in the manage role section:

containsstring('<your tablename>'[user access] , userprincipalname())

Please be aware that the USERPRINCIPALNAME() and USERNAME() might return different results on Power BI Desktop and in Power BI Service.

 

Hopefullly this is what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.