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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
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.