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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Shruikan
New Member

Find a specific row of a one-to-many relationship and return a value

Hello everyone

Very new in Power BI (e tbh reports).

I have two tables in a one-to-many relationship where the parent's "registration ID" is the key to the related child records. Each row in the parent table relates to many rows in the child table.

I'm trying to create a report in which I need to extract a specific child record based on a column and then return another column from the same row.

Sample tables:

Table 1 - Parent Table

Registration IDNumber
1234Already
5678Tina

Table 2 - children's table

Parent linkNumberValue
1234date_112/03/2010
1234date_205/05/2012
1234text_1Test text here
1234text_2Some how things test here
5678date_129/08/2009
5678date_211/12/2020
5678text_1More test placeholder material
5678text_2testing 123

What I need in the report:

For each record in Table 1 I need to add a column "Date 1" and "Date 2" and fill it with the "value" field in Table 2 where "Date 1" is the secondary record related to Name "date_1" and "Date 2" is the secondary record related to Name "date_2".

Example of output:

NumberDate 1Date 2
Already12/03/2010

05/05/2012

Tina29/08/2009

11/12/2020

Any guidance on how I can do this would be greatly appreciated. Thank you!

1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Hi,

see figure:

18-03-_2020_00-12-18.png

 

Regards FrankAT

 

View solution in original post

2 REPLIES 2
FrankAT
Community Champion
Community Champion

Hi,

see figure:

18-03-_2020_00-12-18.png

 

Regards FrankAT

 

You

Are

Amazing

 

 

Thank you so much, and thanks for the quick response!

Just for the record I had to replace ";" with "," for it to work, but other than that this is exactly what I needed. You're the best.

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.