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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Employee Manager - Calculated column

Dear All,

 

Looking for your help in below scenario either in calculated column or in M-query form.

 

I have the details as Ename, Role & Mname.

This is a basic query in SQL i.e. a manager can be an employee but all employee cannot be manager. I need to find the list of employees under each manager.

 

So I need to derive a new column in PowerBI which might say if title is manager or not.

Further I can apply row level security for each manager so they can see only the employee under them.

 

Hope you could help me in deriving the last column "Title".

 

Abhi_hgt_0-1601985214568.png

 

 

Regards,

Abhi

1 ACCEPTED SOLUTION

@Anonymous 

I am not sure how you will utilize this field, however, I have modified the code, please check now.

Title = 
VAR _M = 
    CALCULATETABLE( 
        VALUES('Table'[Ename]),
        'Table'[Role] = "Manager"
    )
RETURN

IF( NOT [Ename] IN _M, "SM", BLANK()) 

Fowmy_0-1602052820285.png

________________________

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

View solution in original post

5 REPLIES 5
Fowmy
Super User
Super User

@Anonymous 

Not clear about the requirement and the output expected. 

is it a Column like:

Title = IF( [Role] = "Manager", Blank(), "SM")

________________________

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

Anonymous
Not applicable

I dont think it will work.

Basically I need to display the list of employees under each manager....

@Anonymous 

Add this as a new column:

Title = 
VAR _M = 
    CALCULATETABLE( 
        VALUES('Table'[Ename]),
        'Table'[Role] = "Manager"
    )
RETURN

IF( [Ename] IN _M, 
    CONCATENATEX(
        FILTER( 'Table', 'Table'[Mname] = EARLIER('Table'[Ename])),
        [Ename], "|")

)

Fowmy_0-1601990617750.png

________________________

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

Anonymous
Not applicable

This is not the output I am looking for. 

I need,

 

Abhi_hgt_0-1602050530908.png

 

@Anonymous 

I am not sure how you will utilize this field, however, I have modified the code, please check now.

Title = 
VAR _M = 
    CALCULATETABLE( 
        VALUES('Table'[Ename]),
        'Table'[Role] = "Manager"
    )
RETURN

IF( NOT [Ename] IN _M, "SM", BLANK()) 

Fowmy_0-1602052820285.png

________________________

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.