March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I am trying to turn this dataset into the one below and unpivot doesn't quite seem to work. Any advice on this?
Team | player1.first | player1.last | player2.first | player2.last | player3.first | player3.last |
Green | Sally | Jensen | John | Dawson | Claire | Watson |
Purple | Steve | Wells | Terry | Wu | Gina | Smith |
Team | first | last |
Green | Sally | Jensen |
Green | John | Dawson |
Green | Claire | Watson |
Purple | Steve | Wells |
Purple | Terry | Wu |
Purple | Gina | Smith |
Solved! Go to Solution.
=#table({"Team","First","Last"},List.TransformMany(Table.ToRows(PreviousStepName),each List.Split(List.Skip(_),2),(x,y)=>{x{0}}&y))
Thanks Daniel, that works great for the sample dataset.
However, I'm trying to apply the solution to our slightly more complex data using the following
= #table({"Ballot ID","Participant ID","Participant CustNum","VotedFlag","First Name","Last Name","Current Employer","Committee Join Date","Committee Drop Date"},List.TransformMany(Table.ToRows(#"Changed Type"),each List.Split(List.Skip(_),8),(a,b,c,d,e,f,g,h)=>{a{0}}&b))
But I don't know how to assign the 8 items using =>{a{0}}&b)...... I don't really know what this is doing.
Can you please let me know how to do this? Thanks in advance
= #table({"Ballot ID","Participant ID","Participant CustNum","VotedFlag","First Name","Last Name","Current Employer","Committee Join Date","Committee Drop Date"},List.TransformMany(Table.ToRows(#"Changed Type"),each List.Split(List.Skip(_),8),(x,y)=>List.FirstN(x,8)&y))
I finally figured out that (x,y)=>{x{0}}&y is like a name,value pair so I tried the following command and it works! Thanks so much!
= #table({"Ballot ID","Participant ID","Participant CustNum","VotedFlag","First Name","Last Name","Current Employer","Committee Join Date","Committee Drop Date"},List.TransformMany(Table.ToRows(#"Removed Other Columns"),each List.Split(List.Skip(_),8),(x,y)=>{x{0}}&y))
=#table({"Team","First","Last"},List.TransformMany(Table.ToRows(PreviousStepName),each List.Split(List.Skip(_),2),(x,y)=>{x{0}}&y))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
16 | |
13 | |
12 | |
9 |
User | Count |
---|---|
36 | |
31 | |
20 | |
19 | |
17 |