Forum Discussion
SBR1D
Helper III
2 years agoTricky calculated column lookup
Hi All In the following example table I want to do a calculated column to look up from the application table to employer table returning the Parent Employer. name. I've filled in what the o...
- 2 years ago
There are PATH functions that can handle recursive hierarchy structures like I think your Employer table is intended to have. See here for details on that: https://www.daxpatterns.com/parent-child-hierarchies/
For this, you can probably get away with two lookups like this:
Parent Employer Name = VAR _ParentID = LOOKUPVALUE ( Employer[ParentID], Employer[EmployerID], Applications[EmployerID] ) VAR _ParentName = LOOKUPVALUE ( Employer[Employer name], Employer[EmployerID], _ParentID ) RETURN _ParentName
AlexisOlson
Super User
2 years agoThere are PATH functions that can handle recursive hierarchy structures like I think your Employer table is intended to have. See here for details on that: https://www.daxpatterns.com/parent-child-hierarchies/
For this, you can probably get away with two lookups like this:
Parent Employer Name =
VAR _ParentID =
LOOKUPVALUE (
Employer[ParentID],
Employer[EmployerID], Applications[EmployerID]
)
VAR _ParentName =
LOOKUPVALUE (
Employer[Employer name],
Employer[EmployerID], _ParentID
)
RETURN
_ParentName