How to transpose the columns and ensure that rows are repeated accordingly?
Dataset has the following data :-
Date | Year | Month | Day | USD | EUR | JPY |
---|---|---|---|---|---|---|
1/1/1994 | 1994 | 1 | 1 | 10 | 20 | 5 |
1/1/1995 | 1995 | 1 | 1 | 12 | 30 | 10 |
The expected output is :-
Date | Year | Month | Day | Currency | Currency/CCY |
---|---|---|---|---|---|
1/1/1994 | 1994 | 1 | 1 | USD | 10 |
1/1/1994 | 1994 | 1 | 1 | EUR | 20 |
1/1/1994 | 1994 | 1 | 1 | JPY | 5 |
1/1/1995 | 1995 | 1 | 1 | USD | 12 |
1/1/1995 | 1995 | 1 | 1 | EUR | 30 |
1/1/1995 | 1995 | 1 | 1 | JPY | 10 |
This can be accomplished quickly and easily using POWER QUERY. To achieve this using the said procedure, follow the steps:
Table1
Or, Using
Excel Formulas
toUNPIVOT OTHER COLUMNS
• Formula used in cell A6