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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
justoneusername
Regular Visitor

Getting the successor up to 3rd Level

Dear Guru of PowerBI,
I have this table with three columns :
Worker Name | Successor | Status Plan

A worker could have not a successor or could more than 2 (from 0 to 3).
If I do manually the search 
1) Take Worker Name
2) See Successor 
3) Take Successor and look it up in Worker Name column

With step 3, I'm able to find the successor, but with dax code I can't 

SuccLevel2 = 
VAR Suclevel1 = LOOKUPVALUE(<Successor Name>, <Worker Name>, <Worker Name>)
VAR Suclevel2 = LOOKUPVALUE(<Successor Name>, <Worker Name>, Successore1)

return Suclevel2

 

How can I do it?

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

Hi @justoneusername 

 

Thanks for the reply from @lbendlin .

 

@justoneusername , here is my testing for your reference:

 

My sample:

vxuxinyimsft_0-1718869677157.png

 

Create a calculated column as follows

 

CombinedSuccessors = 
VAR SuccLevel1 = LOOKUPVALUE('Table'[Successor], [worker name], [Worker Name])
VAR SuccLevel2 = LOOKUPVALUE('Table'[Successor], [worker name], SuccLevel1)
VAR SuccLevel3 = LOOKUPVALUE('Table'[Successor], [worker name], SuccLevel2)
RETURN
IF(ISBLANK(SuccLevel1), BLANK(), SuccLevel1) & 
IF(ISBLANK(SuccLevel2), BLANK(), "," & SuccLevel2) & 
IF(ISBLANK(SuccLevel3), BLANK(), "," & SuccLevel3)

 

 

Output:

vxuxinyimsft_1-1718869764900.png

 

If this sample data is structurally different from the one you are using, please provide some sample data and the results you are hoping for: How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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

3 REPLIES 3
v-xuxinyi-msft
Community Support
Community Support

Hi @justoneusername 

 

Thanks for the reply from @lbendlin .

 

@justoneusername , here is my testing for your reference:

 

My sample:

vxuxinyimsft_0-1718869677157.png

 

Create a calculated column as follows

 

CombinedSuccessors = 
VAR SuccLevel1 = LOOKUPVALUE('Table'[Successor], [worker name], [Worker Name])
VAR SuccLevel2 = LOOKUPVALUE('Table'[Successor], [worker name], SuccLevel1)
VAR SuccLevel3 = LOOKUPVALUE('Table'[Successor], [worker name], SuccLevel2)
RETURN
IF(ISBLANK(SuccLevel1), BLANK(), SuccLevel1) & 
IF(ISBLANK(SuccLevel2), BLANK(), "," & SuccLevel2) & 
IF(ISBLANK(SuccLevel3), BLANK(), "," & SuccLevel3)

 

 

Output:

vxuxinyimsft_1-1718869764900.png

 

If this sample data is structurally different from the one you are using, please provide some sample data and the results you are hoping for: How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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

lbendlin
Super User
Super User

Have you considered using the PATH functions instead?

Yes, I've considered PATH function but since some successor are not present in dataset, PATH returns an error (That is correct).

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.