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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Super User
Super User

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
Super User
Super User

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.