Forum Discussion
Taffalaffa
Helper I
2 years agoConvert a list into columns in a table
Hi. I have the following table which is called activitycodeassignment. This is just a small filtered version for the purposes of my question. There is the a column that has the Code Category (ther...
- 2 years ago
Hi,
This code works
let Source = Excel.Workbook(File.Contents("C:\Users\mathu\Desktop\Try.xlsx"), null, true), #"Removed Other Columns" = Table.SelectColumns(Source,{"Data"}), #"Expanded Data" = Table.ExpandTableColumn(#"Removed Other Columns", "Data", {"Column1", "Column2", "Column3", "Column4", "Column5"}, {"Column1", "Column2", "Column3", "Column4", "Column5"}), #"Promoted Headers" = Table.PromoteHeaders(#"Expanded Data", [PromoteAllScalars=true]), #"Removed Columns" = Table.RemoveColumns(#"Promoted Headers",{"Code ID"}), #"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[#"Code Category"]), "Code Category", "Code Value") in #"Pivoted Column"Hope this helps.
Taffalaffa
Helper I
2 years agoThank you so much Ashish! This is spectacular!
Ashish_Mathur
Super User
2 years agoYou are welcome.