Forum Discussion
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.
Cheers
Abhi
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" )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.
4 Replies
- amitchandakSuper 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- AnonymousNot 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
- FowmySuper User
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 🙂
- v-janeyg-msftCommunity 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" )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.