Forum Discussion
JohnJairoV
9 years agoHelper I
Reorder data with Power Query repeating words
Hi to all!
I have this data:
| Pais | Aire | Agua | Tierra | Fuego |
| Colombia | 1 | 3 | 2 | |
| Argentina | 2 | 2 | 1 | |
| México | 1 | 1 | 2 | |
| Perú | 1 | 3 | 1 |
And I like to transform with Power Query, like this:
| Pais | Objeto |
| Colombia | Aire |
| Colombia | Tierra |
| Colombia | Tierra |
| Colombia | Tierra |
| Colombia | Fuego |
| Colombia | Fuego |
| Argentina | Aire |
| Argentina | Aire |
| Argentina | Agua |
| Argentina | Agua |
| Argentina | Tierra |
| México | Agua |
| México | Tierra |
| México | Fuego |
| México | Fuego |
| Perú | Aire |
| Perú | Agua |
| Perú | Agua |
| Perú | Agua |
| Perú | Fuego |
Thx in advance for your answers.
Unpivot all but the first columns,
add a column with nested lists with the numbers {1 thru Value},
expand this column,
remove this column and the Value column,
adjust the header Attribute to Objeto as illustrated in this video.
2 Replies
- MarcelBeugCommunity Champion
Unpivot all but the first columns,
add a column with nested lists with the numbers {1 thru Value},
expand this column,
remove this column and the Value column,
adjust the header Attribute to Objeto as illustrated in this video.
- JohnJairoVHelper I
Great MarcelBeug! Works like a charm. Blessings to you!