Forum Discussion
Get Manager ID from Employee Full Name vs. Incomplete Manager Name
Hi UncleCaesar ,
You can try formula like below:
ManagerID =
VAR CurrentEmployeeName = 'YourTable'[EmployeeName]
VAR ManagerName = 'YourTable'[ManagerName]
VAR CurrentEmployeeID = 'YourTable'[EmployeeID]
VAR ManagerID =
IF (
ISBLANK ( CurrentEmployeeName ) || ISBLANK ( ManagerName ),
BLANK (),
VAR ManagerNameList =
VALUES ( 'YourTable'[ManagerName] )
VAR ManagerIDList =
FILTER ( 'YourTable', CONTAINSSTRING ( CurrentEmployeeName, [ManagerName] ) )
RETURN
MAXX ( ManagerIDList, [EmployeeID] )
)
RETURN
ManagerID
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This output is what I'm looking for. Thank you!
For some reason, it doesn't work for me 😞 It is a little buggy, not sure what I might be doing wrong.
- Anonymous2 years agoNot applicable
Hi UncleCaesar ,
You need to create a calculated column instead of a measure, which is probably why you're getting it wrong. Refer to below pbix file.
Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- UncleCaesar2 years agoRegular Visitor
Hi, looking closely it doesn't work for you either, cause Barbara Streisand has Manager ID "2" instead of "3" and John Kenneth appears correct only on the 2nd row, on the 3rd one it's blank.