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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LeviCaers
Frequent Visitor

Nested column to new table

Hi,

I want to create a new table that combines two columns from different tables.
Table A
A
B
C

Table B
1
2
3

Result
A 1
A 2
A3
B 1
B 2
B 3
C 1
C 2
C3

Both values should be in different columns in the result table.

Anyone that knows how to do this?

Cheers

1 ACCEPTED SOLUTION
v-danhe-msft
Employee
Employee

Hi @LeviCaers,

I have tried alena2k's function and added some steps that you could refer to:

Sample data:

1.PNG

Add customer column in Table A:

1.PNG

Expand it and format the Customer.Number as Text:

1.PNG

Add customer column:

1.PNG

Remove the other columns and you could see the correct result.

1.PNG 

You could also download the pbix file the have a view:

https://www.dropbox.com/s/j8qlxt9vla8uns7/Nested%20column%20to%20new%20table.pbix?dl=0

 

Regards,

Daniel He

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

2 REPLIES 2
v-danhe-msft
Employee
Employee

Hi @LeviCaers,

I have tried alena2k's function and added some steps that you could refer to:

Sample data:

1.PNG

Add customer column in Table A:

1.PNG

Expand it and format the Customer.Number as Text:

1.PNG

Add customer column:

1.PNG

Remove the other columns and you could see the correct result.

1.PNG 

You could also download the pbix file the have a view:

https://www.dropbox.com/s/j8qlxt9vla8uns7/Nested%20column%20to%20new%20table.pbix?dl=0

 

Regards,

Daniel He

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

You can easily do it in Power Query: add second table as a custom column for the first one and expand it.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each TableB),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Column1"}, {"Custom.Column1"})
in
    #"Expanded Custom"

 

image.png 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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