Forum Discussion

ephramz's avatar
ephramz
Helper II
4 years ago
Solved

How do i duplicate rows

How do I duplciate rows based on column value in another table

E.g.

Table 1
Customers   Sales Number  Order Number  Year
Alex               1111111           111222            2015
Alex               1111111           111222            2016
Alex               1111111           111222            2017


Table 2
Customers   Sales Number  Order Number  Sales   
Alex               1111111           111222            200
Alex               1111111           111222            300
Alex               1111111           111222            400

Desired Output
Customers   Sales Number  Order Number  Sales   Year
Alex               1111111           111222            200     2015
Alex               1111111           111222            200     2016
Alex               1111111           111222            200     2017
Alex               1111111           111222            300     2015
Alex               1111111           111222            300     2016
Alex               1111111           111222            300     2017
Alex               1111111           111222            400     2015
Alex               1111111           111222            400     2016
Alex               1111111           111222            400     2017

I know that there is a custom column in the power quer editor, however im unsure what the formula might be.

The 2 table have matching columns "Customers   Sales Number  Order Number"

2 Replies