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
Syndicate_Admin
Administrator
Administrator

Boss/employee segmenter

Good morning, I have the following problem. I have a table with user code, name and boss code. I want to generate a segmenter that allows me to select a name and bring me the data of that user and all their employees.

9 REPLIES 9
Syndicate_Admin
Administrator
Administrator

And for an event to go under investigation, it must first be classified. And in order to generate the actions, it must first be investigated.

Syndicate_Admin
Administrator
Administrator

NicolasN99_0-1764677131009.png

NicolasN99_1-1764677176541.png

It would be so, the first table is the table of facts. It contains the event number, the code of the person who classifies it, classification status, the research number (which coincides with the event number), the code of the person who investigates it, the status of the research, the action code (several actions can be derived from an investigation), the code of the person who must perform it and the status of the action. A person may have to classify, investigate or perform an action. The second table has the codes of each user, the name and the code of their boss. In the example case it is a linear chain: So-and-so is the boss of So-and-so and So-and-so is the boss of Pepito. What I want to achieve is a visual with events and research (since they have the same code) and a visual one with the actions. And put a person in the slicer. So if I put So-and-so I should see all the data of the tasks. If I put Menganito I should see the data of Menganito and Pepito's tasks. If I put Jiminy to see Jiminy's data alone because he has no subordinates.

Anonymous
Not applicable

Hi @Syndicate_Admin ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a table.

Slicer_name = VALUES('Table'[Nombre])

vtangjiemsft_0-1727319207280.png

(3) We can create a measure. 

Flag = 
var _slicer=SELECTEDVALUE('Slicer_name'[Nombre])
var _boss_code=CALCULATE(SUM('Table'[Codigo Jefe]),FILTER(ALL('Table'),[Nombre]=_slicer))
RETURN IF(MAX('Table'[Codigo Jefe])=_boss_code,1,0)

(4) Place [Flag=1] on the visual 1 and visual 2 object's filter and then the result is as follows.

By selecting the user name in the slicer, visual object 1 will show the boss code for that user and visual object 2 will show all users under that user's boss.

vtangjiemsft_1-1727319743275.png

 

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Hello good afternoon, what I want you to do is that if you select a user bring all the subordinates and the subordinates of their subordinates, until you reach the person without subordinates

Hi,

The PARCHCONTAINS() function should work.  For more specific help, share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

EventEvent DescriptionSorterClassification StatusResearchResearch LeaderResearch StatusActionAction Description ResponsibleStatement of Action
1-200Classified1201Investigated1-202Made
1-200Classified1201Investigated2-200Made
2-201Not Classified
3-202Classified3200Not Investigated
4-200Classified4201Investigated3-202Made
4-200Classified4201Investigated4-202Earring
4-200Classified4201Investigated5-201Earring
5-201Classified5202Investigated6-200Made
5-201Classified5202Investigated7-200Made
5-201Classified5202Investigated8-201Made
5-201Classified5202Investigated9-202Earring
5-201Classified5202Investigated10-200Earring

User CodeUserBoss Code
200So-and-so-
201Stuttgart200
202Pepito201

Due to confidentiality issues I cannot upload the original tables. By way of example, these would be these. The objective would be if I select So-and-so to see all the data in three different visuals one for events, one for research and one for actions, if I select So-and-so to see only his data and Pepito's. And finally, if Pepito was selected, only see his data.

Sorry but cannot understand anything there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Sorry for the data in this way but it did not let me load excel or power bi.

Syndicate_Admin
Administrator
Administrator

NicolasN99_0-1727268102260.png

The table would look like this and is connected to other tables using user code.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors