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.
Hello, im having some issues with these 2 tables: im trying to merge these 2 tables in power query. The following have the structure:
Table 1: has 14 lines
Code
A00698919717702
A00498968207604
A00098917007702
A00098917007604
A0079893971
A00798916717706
A00798916717604
A00998920717704
A00998920717604
A0019869071
A00998976717604
A0009866770
A00198605707706
A00098906067501
Table 2: has 730 lines
Date Month Week Gross Losses Net
1/1/22 1 52 0 0 0
1/2/22 1 52 0 0 0
1/3/22 1 1 0 0 0
1/4/22 1 1 0 0 0
1/5/22 1 1 0 0 0
1/6/22 1 1 0 0 0
1/7/22 1 1 0 0 0
1/8/22 1 1 0 0 0
1/9/22 1 1 0 0 0
1/10/22 1 2 0 0 0
1/11/22 1 2 0 0 0
1/12/22 1 2 0 0 0
1/13/22 1 2 0 0 0
....
Im essentialy trying to merge both tables; the result would be table 2 with (14x730 = 10220 lines) and the original columns, with one additional column that shows each specific date for each product of table 1.
Date Month Week Gross Losses Net Code
1/1/22 1 52 0 0 0 A00698919717702
1/2/22 1 52 0 0 0 A00698919717702
1/3/22 1 1 0 0 0 A00698919717702
1/4/22 1 1 0 0 0 A00698919717702
1/5/22 1 1 0 0 0 A00698919717702
1/6/22 1 1 0 0 0 A00698919717702
1/7/22 1 1 0 0 0 A00698919717702
1/8/22 1 1 0 0 0 A00698919717702
1/9/22 1 1 0 0 0 A00698919717702
1/10/22 1 2 0 0 0 A00698919717702
1/11/22 1 2 0 0 0 A00698919717702
1/12/22 1 2 0 0 0 A00698919717702
1/13/22 1 2 0 0 0 A00698919717702
Thank you very much,
Solved! Go to Solution.
In the Table 2 you can add custom column = "#Table 1", something like this:
let
Source = #"Table 2",
#"Added Custom" = Table.AddColumn(Source, "Custom", each #"Table 1")
in
#"Added Custom"
and then expand the result
NewStep=#table(Table.ColumnNames(Table2)&{"Code"},List.TransformMany(Table.ToRows(Table2),each Table1[Code],(x,y)=>x&{y}))
In the Table 2 you can add custom column = "#Table 1", something like this:
let
Source = #"Table 2",
#"Added Custom" = Table.AddColumn(Source, "Custom", each #"Table 1")
in
#"Added Custom"
and then expand the result
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.