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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Need help in filtering data - show only if USERPRINCIPALNAME matches the group of users(topmanagers)

Hi!

 

I have the below table wherein only the TopManagers people can see this data - I tried the following Measures:

 

  • FilterByTopManagers = IF(CONTAINSROW({USERPRINCIPALNAME()},selectedvalue(TimeReport[TopManagers])),1,0)
  • FilterByTopManagers = IF(SELECTEDVALUE(TimeReport[TopManagers]) IN {USERPRINCIPALNAME()},0,1)
  • Table = FILTER(TimeReport, TimeReport[Title] = USERPRINCIPALNAME())

You help/suggestion would be appreciated - thanks.

 

FunctionDepartmentCityRevenueTopManagers
TDSalesPune1Mjohn@abc.com; sarah@abc.com; myriam@abc.com
ADHRMumbai2Mraj@abc.com; shirish@abc.com; john@abc.com
TIDProcurementDelhi3Msarah@abc.com; john@abc.com

 

 

 

 

3 REPLIES 3
Anonymous
Not applicable

I have tried to get the data with the below Dax query - it is working however getting filtered with the current logged in user.

What I want is: If TopManagers equal or contains USERPRINCIPALNAME() then show all data.
Using SQL it would be: SELECT * FROM TimeReport WHERE TimeReport[TopManagers] IN (USERPRINCIPALNAME())

 

New Table =
CALCULATETABLE (
SELECTCOLUMNS (
TimeReport,
"Neukunden_Akquise_Systeme", TimeReport[Neukunden_Akquise_Systeme],
"Neukunden_Akquise_Produkte", TimeReport[Neukunden_Akquise_Produkte],
"User Name", TimeReport[User Name]
),
CONTAINSSTRING(TimeReport[TopManagers], "john@abc.com")
)
amitchandak
Super User
Super User

@Anonymous , My advice is, if possible, split the TopManagers column in power query into rows

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit,

 

I gave it a try however it doesn't look optimal - TopManagers values get split into columns so it can be 2 or 3 or 5 columns as I am getting the Top Managers of a user dynamically as per the Organization Chart.

Therefore evaluating how many top managers would a user have and then querying all these columns would be tedious hence dropping this idea.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.