PDA

View Full Version : [SOLVED:] Power Query to transpose a dataset



ainotayev
05-17-2023, 08:12 PM
Hello.

Please reference the attached file with three sheets as current (sheet1), unpivoted (sheet2) and final (sheet3).

This has to be done in PQ, because the unpivoted data set produces over 1 million records.

Thanks!

p45cal
05-18-2023, 05:30 AM
Take a look at the table at cell A5 of the Final sheet.
Not yet generalised/flexible. No handling differerent numbers of columns in source data yet.
Could do with a bit more sample data.

ainotayev
05-18-2023, 06:59 AM
Well, thank you kind sir. Please see attached expanded dataset.

p45cal
05-18-2023, 08:54 AM
See the attached at cell A1 of the Final sheet.
Only 5 rows big at the moment to save space, so needs refreshing to see the full list.

ainotayev
05-18-2023, 09:52 AM
I tested it on the full dataset, and it looks to be performing flawlessly. Thank you!

ainotayev
05-24-2023, 02:20 PM
Hi p45cal.

Would you be able and willing to offer a variation of your code to extract an unpivoted list of distinct Key | Value(s)?

Thanks!

p45cal
05-24-2023, 03:11 PM
See the sheet Table2 in the attached.

ainotayev
05-25-2023, 06:38 AM
See the sheet Table2 in the attached.

Thank you, Sir.