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
antbob
Frequent Visitor

Calculated column to lookup multiple matching values across multiple tables

Hi all,

 

I am having some trouble building this out, hopefully as a caluclated column, but can approach this differently if need be.

I have three different tables (Content, Mapping, Product).

Each piece of content and product is a unique listing in their respective tables, but a piece of content can be associated to multiple products, hence where the mapping table comes in.

I am trying to create calculated columns within the content table that show where each piece of content is published (ie. ProductA, ProductB, ProductC). This data is pulled from a database and contains a few thousand pieces of content I need to map out.

 

Content Table

ContentContentID
ContentA1234
Contentb1235
Content-C1236
Content D1237

 

Mapping Table

SourceIDDestinationID
12345242
12345244
12355243
12365243
12365242
12365245
12375243
12375244

 

Product Table

ProductProductID
ProductA5242
ProductB5243
ProductC5244
ProductD5245

 

End Goal Content Table

ContentContentIDProductIDProducts
ContentA12345242, 5244ProductA, ProductC
Contentb12355243ProductB
Content-C12365242, 5243, 5245ProductA, ProductB, ProductD
Content D12375243, 5244ProductB, ProductC

 

I would greatly appreciate anyone's assistance on this one.

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

hi, @antbob 

You could use CONCATENATEX Function to get it.

Step1:

Create the relatuoship as below:

1.JPG

Note: Cross filter direction must be "Both"

Step2:

Add two calculate column

ProductID = CONCATENATEX(RELATEDTABLE('Product'),[ProductID],",")
Products = CONCATENATEX(RELATEDTABLE('Product'),'Product'[Product],",")

result:

2.JPG

 

Best Regards,

Lin

Community Support Team _ Lin
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

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi, @antbob 

You could use CONCATENATEX Function to get it.

Step1:

Create the relatuoship as below:

1.JPG

Note: Cross filter direction must be "Both"

Step2:

Add two calculate column

ProductID = CONCATENATEX(RELATEDTABLE('Product'),[ProductID],",")
Products = CONCATENATEX(RELATEDTABLE('Product'),'Product'[Product],",")

result:

2.JPG

 

Best Regards,

Lin

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

Thank you for this @v-lili6-msft. Worked perfectly

BIAB
Resolver I
Resolver I

Ensure your table relationships are set properly.
Capture 1544.PNGCapture 1545.PNG

 



antbob
Frequent Visitor

Thanks for the input, but unforuntately I am accounting for multiple products that are associated with a piece of content.  Please take a look at the last table I provided which shows the expected result I am working towards.

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!

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.