cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Lookup Multiple Values that are mapped through three different 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

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Lookup Multiple Values that are mapped through three different tables

Hi @antbob ,

You can use content table to create a table visual, then add below measure formulas to lookup related fields values:

Merge ProductID =
VAR _conlist =
    CALCULATETABLE ( VALUES ( Content[ContentID] ), VALUES ( Content[Content] ) )
RETURN
    CALCULATE (
        CONCATENATEX ( VALUES ( Mapping[DestinationID] ), [DestinationID], "," ),
        FILTER ( ALLSELECTED ( Mapping ), [SourceID] IN _conlist )
    )

Merge Products =
VAR _conlist =
    CALCULATETABLE ( VALUES ( Content[ContentID] ), VALUES ( Content[Content] ) )
VAR _destID =
    CALCULATETABLE (
        VALUES ( Mapping[DestinationID] ),
        FILTER ( ALLSELECTED ( Mapping ), [SourceID] IN _conlist )
    )
RETURN
    CALCULATE (
        CONCATENATEX ( VALUES ( Product[ProductID] ), [ProductID], "," ),
        FILTER ( ALLSELECTED ( Product ), [ProductID] IN _destID )
    )

Regards,
Xiaoxin Sheng

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

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Lookup Multiple Values that are mapped through three different tables

Hi @antbob ,

You can use content table to create a table visual, then add below measure formulas to lookup related fields values:

Merge ProductID =
VAR _conlist =
    CALCULATETABLE ( VALUES ( Content[ContentID] ), VALUES ( Content[Content] ) )
RETURN
    CALCULATE (
        CONCATENATEX ( VALUES ( Mapping[DestinationID] ), [DestinationID], "," ),
        FILTER ( ALLSELECTED ( Mapping ), [SourceID] IN _conlist )
    )

Merge Products =
VAR _conlist =
    CALCULATETABLE ( VALUES ( Content[ContentID] ), VALUES ( Content[Content] ) )
VAR _destID =
    CALCULATETABLE (
        VALUES ( Mapping[DestinationID] ),
        FILTER ( ALLSELECTED ( Mapping ), [SourceID] IN _conlist )
    )
RETURN
    CALCULATE (
        CONCATENATEX ( VALUES ( Product[ProductID] ), [ProductID], "," ),
        FILTER ( ALLSELECTED ( Product ), [ProductID] IN _destID )
    )

Regards,
Xiaoxin Sheng

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

View solution in original post

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors