Cartesian Joins by rows with the same ID

Smogu

New member
Joined
Jan 26, 2017
Messages
1
Reaction score
0
Points
0
Hello,

I have table like this:

IDWord
ID1A
ID1B
ID2C
ID2D

I need to do in PowerQuery Cartesian Joins by rows with the same ID:

IDWordWord_1
ID1AA
ID1AB
ID1BA
ID1BB
ID2CC
ID2CD
ID2DC
ID2DD

Thanks to suggestions.
 
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="YourTableName"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"ID"}, {{"tbl", (x) => Table.AddColumn( x, "Word_1", each x[Word]), type table}}),
    #"Removed Columns" = Table.RemoveColumns(#"Grouped Rows",{"ID"}),
    #"Expanded {0}" = Table.ExpandTableColumn(#"Removed Columns", "tbl", {"ID", "Word", "Word_1"}, {"ID", "Word", "Word_1"}),
    #"Expanded {0}1" = Table.ExpandListColumn(#"Expanded {0}", "Word_1")
in
    #"Expanded {0}1"

Regards
 
Back
Top