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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
CarlsBerg999
Helper V
Helper V

Lookup from the same table

Hi, 

 

My data looks like the picture below. What i need to do is a calculated column (green), where each Child gets the name of the Parent.

- Each Child has a Parent 

- The Parent column works as a lookup for the ID column in the same table 

 

CarlsBerg999_0-1657377923161.png

 

What i have so far is: 

CALCULATE(MAX('Table'[Name]),
FILTER('Table','Table'[ID]=EARLIER('Table'[Parent])))

 

--> This produces empty values. Does anyone have an idea how to fix this?

 

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

Hi, @CarlsBerg999 ;

You could use column or measure by dax:

 

COLUMN = 
 CALCULATE(MAX('Table'[Name]),
FILTER('Table','Table'[ID]=EARLIER('Table'[Parent])))
Measure = 
 CALCULATE(MAX('Table'[Name]),
FILTER(ALL('Table'),'Table'[ID]=MAX('Table'[Parent])))

 

The final show:

vyalanwumsft_0-1657609527387.png


Best Regards,
Community Support Team _ Yalan Wu
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
speedramps
Community Champion
Community Champion

Please click thumbs up and accept one of the solutions. Thank you.

v-yalanwu-msft
Community Support
Community Support

Hi, @CarlsBerg999 ;

You could use column or measure by dax:

 

COLUMN = 
 CALCULATE(MAX('Table'[Name]),
FILTER('Table','Table'[ID]=EARLIER('Table'[Parent])))
Measure = 
 CALCULATE(MAX('Table'[Name]),
FILTER(ALL('Table'),'Table'[ID]=MAX('Table'[Parent])))

 

The final show:

vyalanwumsft_0-1657609527387.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

speedramps
Community Champion
Community Champion

Try this .... 

 

Goal =

VAR myparent= SELECTEDVALUE('Table'[Parent])
RETURN
CALCULATE(
SELECTEDVALUE('Table'[Name]),
ALL('Table'),
'Table'[ID] = myparent
)
 
Nect time please copy and paste example tables as data into chats so we cam import the data and build solutions. Dont send snap shorts. It takes ages to retype it ☹️
 

Thanks for reaching out for help.

I have helped you, now please help me by giving kudos.

Remeber we are unpaid volunteers.

Click the thumbs up and accept as solution button. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you !

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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