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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
AnnaWho
New Member

HELP Please: Show the Data But Not All the Details (Data Filtering Based on USERPRINCIPALNAME?)

Hello,

I have a table that shows production and I would like all employees to see everyone's production but only see their own name (the rest of the names should be blank). This I have achieved using this DAX below. However, if the user logged in is a supervisor (the Employees table has a Supervisor column with a Yes or No value), there should be no filters and he/she should see all data. In the screenshot below, if Princess Leia is a supervisor, she should see all the Employee Names. Also, the supervisor may or may not have production numbers in the table. Any suggestions for how to do this? I would appreciate any help please.

 

EmployeeName =
IF(
    SUM('Production'[Quantity])
    &&
    SELECTEDVALUE('Employees'[LogInEmail])=USERPRINCIPALNAME(),
    SELECTEDVALUE('Employees'[Name])
   
)
Here's how it looks - Darth Vader is the user currently logged in. After I took this screenshot, I made Darth Vader a Supervisor and I want all the Employee Names to display instead of just his own name.
AnnaWho_1-1701828577457.png
 
Data tables:
Employees:
AnnaWho_0-1701875324096.png

Production:

AnnaWho_1-1701875364063.png

 

I thought about maybe having a separate Supervisor table that contains a list of supervisors?

AnnaWho_2-1701875477894.png

 

 

Thanks in advance!
3 REPLIES 3
lbendlin
Super User
Super User

You need two copies of your fact table. One table is visible without names.  You create measures for "Mine"  and "Others".  The other table is hidden and has the names. Use RLS to control access to the hidden table.

Thanks! Do you know how I would go about using RLS to access to access the hidden table? When I tried this, it still filtered the hidden the table and only showed me my data. I think it's because under Manage Roles, my table filter is [LogInEmail] = USERPRINCIPALNAME()? Do you know what I should use? I'm fairly new at Power BI & DAX... appreciate any help.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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