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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
timazarj
Helper II
Helper II

Retrieve All related data from another table as a list

 

Hello,

In the model there 2 tables one for customer information and the other one for the product they bought:

Customer:

IDName 
1Brian 
2Tammy 

 

Product

IDProduct
1A
1B
1C
1D
2A
2F

 

I tried to add a new column in the customer table listing all the products: 

IDNameProduct List
1BrianA,B,C,D
2TammyA,F

 

 

Thanks,

1 ACCEPTED SOLUTION

Hi @timazarj ,

 

Please try CONCATENATEX function:

Measure = CONCATENATEX('Table (2)','Table (2)'[Product],",")

Vlianlmsft_0-1644386674238.pngVlianlmsft_1-1644386687563.png

 

 

Best Regards,
Liang
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
timazarj
Helper II
Helper II

Thank you, 

Do you have any idea how can I define it as a measure using DAX.

Hi @timazarj ,

 

Please try CONCATENATEX function:

Measure = CONCATENATEX('Table (2)','Table (2)'[Product],",")

Vlianlmsft_0-1644386674238.pngVlianlmsft_1-1644386687563.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

freginier
Impactful Individual
Impactful Individual

Create these queries in power query

 

Product Table

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXJUitWBsJzgLGc4ywXMMoKrA7HclGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Product = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Product", type text}})
in
    #"Changed Type"

Customer Table

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIqykzMU4rViVYyAvJCEnNzK5ViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Name = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Name", type text}}),
    #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"ID"}, Product, {"ID"}, "Product", JoinKind.LeftOuter),
    #"Expanded Product" = Table.ExpandTableColumn(#"Merged Queries", "Product", {"Product"}, {"Product.1"}),
    #"Renamed Columns" = Table.RenameColumns(#"Expanded Product",{{"Product.1", "Product"}}),
    #"Grouped Rows" = Table.Group(#"Renamed Columns", {"ID", "Name"}, {{"Product", each Text.Combine([Product],","), type nullable text}})
in
    #"Grouped Rows"

 

You should get this 

freginier_0-1643923224229.png

 

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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