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

Employee Manager - Calculated Column

Dear All,

Looking for your help in the following scenario, either in the calculated column or in the query form M.

I have the details like Ename, Role & Mname.

This is a basic query in SQL, that is, a manager can be an employee, but all employees cannot be managers. I need to find the list of employees under each manager.
So I need to derive a new column in PowerBI that could tell if the title is manager or not.

Also, I can enforce row level security for each manager so that they can see only the employee below them.

 

Abhi_hgt_0-1602050632328.png

 

 

Cheers
Abhi

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

It’s my pleasure to answer for you.

According to your description, I think create a calculate column to judge the title is manager or not.

Like this:

Title3 =
IF (
    MAXX (
        FILTER ( ALL ( Table2 ), Table2[Ename] = EARLIER ( Table2[Mname] ) ),
        Table2[Role]
    ) = "Manager",
    "SM"
)

Or a measure:

title =
IF (
    MAXX (
        FILTER ( ALL ( Table2 ), Table2[Ename] = SELECTEDVALUE ( Table2[Mname] ) ),
        Table2[Role]
    ) = "Manager",
    "SM"
)

v-janeyg-msft_0-1602213667206.png

 

If you have other questions, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

View solution in original post

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

It’s my pleasure to answer for you.

According to your description, I think create a calculate column to judge the title is manager or not.

Like this:

Title3 =
IF (
    MAXX (
        FILTER ( ALL ( Table2 ), Table2[Ename] = EARLIER ( Table2[Mname] ) ),
        Table2[Role]
    ) = "Manager",
    "SM"
)

Or a measure:

title =
IF (
    MAXX (
        FILTER ( ALL ( Table2 ), Table2[Ename] = SELECTEDVALUE ( Table2[Mname] ) ),
        Table2[Role]
    ) = "Manager",
    "SM"
)

v-janeyg-msft_0-1602213667206.png

 

If you have other questions, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

amitchandak
Super User
Super User

@Anonymous , Not very clear. Refer if these can help

https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi
https://www.blue-granite.com/blog/using-dynamic-row-level-security-with-organizational-hierarchies

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,

 

Thanks for the response. 

The link you shared is more on RLS, before using RLS I need to derive last column Title which can basically filter all employees based on their manager.

 

Regards,

Abhi

@Anonymous 

Can you refer to this thread on the same: 
https://community.powerbi.com/t5/Desktop/Employee-Manager-Calculated-column/m-p/1417065#M598814

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.