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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.