Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
How do I Transpose a List like:
into another List like:
in Power Query?
Thanks in advance!
Solved! Go to Solution.
= List.Zip( { your_list } )
example: List.Zip( { {1, 2, 3} } ) = { {1}, {2}, {3} }
= List.Zip( { your_list } )
example: List.Zip( { {1, 2, 3} } ) = { {1}, {2}, {3} }
IMHO, this is the best one, I've seen so far. 🙂
Yeah... this is the equivalent to the transpose for lists.
I use it often with Table.RenameColumns; example:
let
Source = Table.FromRecords({
[name_1= "John", address_2= "CA", id_3= "john.doe@company.com"],
[name_1= "Juan", address_2= "MX", id_3= "juan.torres@factory.net"],
[name_1= "João", address_2= "BR", id_3= "joao.silva@empresa.com.br"]
}),
TransposedLists = List.Zip( { /* current column names: */ Table.ColumnNames(Source),
/* new col names */ { "firstName", "country", "email" }
} ),
RenamedCols = Table.RenameColumns(Source, TransposedLists)
in
RenamedCols
let
Source = {1, 2, 3},
New= List.Generate(()=>[a={},b=0], each [b] <= List.Count(Source), each [a={Source{b}},b=[b]+1], each [a])
in
New
Wow! That is a mighty function right there! A little (a lot) out of my leaugue...
Respect!
another option:
List.Transform( yourList_, each {_} )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Table.ToRows(Table.FromList(List))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
15 | |
15 | |
13 | |
12 | |
11 |