Forum Discussion
davidv64
3 years agoNew Member
how to reshape data
Hi, I am new to data reshaping. I have attached a link to a sample spreadsheet which has a raw data worksheet which I'd like to reshape to look like the second worksheet, Desired Output. I don't car...
- 3 years ago
Use this please
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[Role]), "Role", "Participant"), Custom1 = Table.TransformColumnNames(#"Pivoted Column", each Text.Proper(_)) in Custom1
Vijay_A_Verma
3 years agoMost Valuable Professional
A simple pivot should do the trick
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Pivoted Column" = Table.Pivot(Source, List.Transform(List.Distinct(Source[Role]), each Text.Proper(_)), "Role", "Participant")
in
#"Pivoted Column"- davidv643 years agoNew Member
Thank you, Vijay. Where does this code go?
- davidv643 years agoNew Member
Actually, what I get when I use that in PowerQuery is this:
Is there a way to fill in the names into the appropriate roles?
Thank you
- Vijay_A_Verma3 years agoMost Valuable Professional
Use this please
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[Role]), "Role", "Participant"), Custom1 = Table.TransformColumnNames(#"Pivoted Column", each Text.Proper(_)) in Custom1- davidv643 years agoNew Member
Very nice!! Now I need to dissect your code and understand it .... but it works!