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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
anryb
Regular Visitor

Multiple relationships between tables?

Hello all,

 

Brand new to Power Bi and having trouble figuring something out. 

 

I have a product table that contains Product IDs. 

I also have an order table with orders, some of which contain multiple product ids. Right now they are in one cell, but I can split them so that each "line item" is in its own column.

 

How do make this relationship work between the tables when I have 1 product id in product table that needs to be linked to multiple product ids in another? 

 

Thanks!

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@anryb,

 

In Power Query, go to the Order table and split the column with multiple Product IDs into rows (one row per Product ID). Then create the relationship between the tables using Product ID.

 

DataInsights_0-1724360109229.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
v-kongfanf-msft
Community Support
Community Support

Hi @anryb ,

 

Did @DataInsights  reply solve your problem? If so, please mark it as the correct solution, and point out if the problem persists.

 

Best Regards,
Adamk Kong

anryb
Regular Visitor

@DataInsights 

The line item fields are in json and look like the following. This example order has 2 product ids. 

 

Its quite long when copied here so I made a pastebin link:

"line_items": [ { "id": 14419813204035, - Pastebin.com

 

@anryb,

 

Thanks for the example. You could try Transform --> Parse --> JSON for that column, and then split into rows.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




DataInsights
Super User
Super User

@anryb,

 

In Power Query, go to the Order table and split the column with multiple Product IDs into rows (one row per Product ID). Then create the relationship between the tables using Product ID.

 

DataInsights_0-1724360109229.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @DataInsights ,

 

Thanks so much for the response. 

 

My "line item" column that contains the product ids also has other info. Is there way to extract text between delimiters by every instance of that delimiter into a column so that I can do what you suggested? When i extract value by text between delimiter it only grabs the first instance. 

 

anryb_0-1724362829439.png

 

@anryb,

 

You may need to do some additional string manipulation prior to splitting Product ID into rows. The objective would be to remove everything except the Product IDs, and then split into rows. Would you be able to paste an example?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors