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
HelpWanted
Regular Visitor

Merging Tables Without Expanding Column

I am attempting to merge two tables (with the left table already having been merged previously creating a table column). I am wanting to merge these tables without first expanding the column that is being used in that merge.

 

I have attempted to use Table02[Column2] as the column name, but I guess it doesn't like that.

HelpWanted_0-1678733089187.png

To which turns into the error: 

 

Expression.Error: We cannot convert a value of type List to type Text.
Details:
    Value=[List]
    Type=[Type]

 

HelpWanted_1-1678733141532.png

 

So my questions are:

  • Is it possible to merge with Table02[Column2] = "Column2", or am I just going to have to expand Table02 first?
  • If so, how would this be done?

 

1 ACCEPTED SOLUTION
latimeria
Solution Specialist
Solution Specialist

Hi @HelpWanted ,

If I understood well what you are trying to do :

table2:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyjZU0lEqMUo2KjJUitUB8o1gfCOl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t])
in
    Source

table3:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyjZU0lEqMU42KjJUitUB8o1gfCMI3xjKLzFWio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t])
in
    Source

 merge table with t1 & t2:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyjZU0lEqMUw2KjJUitUB8o1gfCOl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Merged Queries" = Table.NestedJoin(Source, {"Column1"}, T2, {"Column1"}, "T2", JoinKind.LeftOuter),
    Custom1 = Table.TransformColumns(
        #"Merged Queries",
        {
            {"T2", 
            each Table.NestedJoin(_, {"Column1"}, T3, {"Column1"}, "T3", JoinKind.LeftOuter)
            }
        }
    ),
    #"Expanded T2" = Table.ExpandTableColumn(Custom1, "T2", {"Column2", "T3"}, {"T2.Column2", "T2.T3"}),
    #"Expanded T2.T3" = Table.ExpandTableColumn(#"Expanded T2", "T2.T3", {"Column2"}, {"T2.T3.Column2"})
in
    #"Expanded T2.T3"

 

 

View solution in original post

1 REPLY 1
latimeria
Solution Specialist
Solution Specialist

Hi @HelpWanted ,

If I understood well what you are trying to do :

table2:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyjZU0lEqMUo2KjJUitUB8o1gfCOl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t])
in
    Source

table3:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyjZU0lEqMU42KjJUitUB8o1gfCMI3xjKLzFWio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t])
in
    Source

 merge table with t1 & t2:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyjZU0lEqMUw2KjJUitUB8o1gfCOl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Merged Queries" = Table.NestedJoin(Source, {"Column1"}, T2, {"Column1"}, "T2", JoinKind.LeftOuter),
    Custom1 = Table.TransformColumns(
        #"Merged Queries",
        {
            {"T2", 
            each Table.NestedJoin(_, {"Column1"}, T3, {"Column1"}, "T3", JoinKind.LeftOuter)
            }
        }
    ),
    #"Expanded T2" = Table.ExpandTableColumn(Custom1, "T2", {"Column2", "T3"}, {"T2.Column2", "T2.T3"}),
    #"Expanded T2.T3" = Table.ExpandTableColumn(#"Expanded T2", "T2.T3", {"Column2"}, {"T2.T3.Column2"})
in
    #"Expanded T2.T3"

 

 

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.

Top Solution Authors