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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jlee724
Frequent Visitor

Userprincipalname if statement

I want to make a statement where when a specific user logs in, they see there name only but all other users names appear as blank, or an x. If I have 26 users, A - Z, and user A logs in, they can only see there name but all other 25 names will show as X. I dont want to eliminate the other users rows as the visual compares User A's averages to the group's average. I will attach a photo to explain that. So, you can see, the red is the individual and the blue is the group. I want to keep all the numbers limit the users view to names where they only see their own name. 

 

 

jlee724_1-1693941091714.png

 

 

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @jlee724 

 

One method is to use Row-level security to mask all names but that of the current user.

See this Medium post for something similar.

 

As an example, I've attached a PBIX.

 

Model diagram:

OwenAuger_0-1694297453478.png

The Salesperson table (filtered using RLS on User = salesperson2@company.com😞

OwenAuger_1-1694297729580.png

The RLS filter is on the Salesperson table:

OwenAuger_2-1694297801050.png

When salesperson2@company.com is the current user, all other Salespeople appear as "X":

OwenAuger_3-1694298932696.png

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

Hi @jlee724 

 

One method is to use Row-level security to mask all names but that of the current user.

See this Medium post for something similar.

 

As an example, I've attached a PBIX.

 

Model diagram:

OwenAuger_0-1694297453478.png

The Salesperson table (filtered using RLS on User = salesperson2@company.com😞

OwenAuger_1-1694297729580.png

The RLS filter is on the Salesperson table:

OwenAuger_2-1694297801050.png

When salesperson2@company.com is the current user, all other Salespeople appear as "X":

OwenAuger_3-1694298932696.png

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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