Forum Discussion
tgjones43
7 years agoHelper IV
Pivot query
Hello. Please can someone advise how I can go from the first table to the second table? Each number, in column A, has a name in column B and occupies one to several rows depending on how many paramet...
- 7 years ago
Hi,
This M code works
let Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"Number", Int64.Type}, {"Name", type text}, {"Parameter", type text}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each "Yes"), #"Pivoted Column" = Table.Pivot(#"Added Custom", List.Distinct(#"Added Custom"[Parameter]), "Parameter", "Custom") in #"Pivoted Column"
Ashish_Mathur
7 years agoSuper User
Hi,
This M code works
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Number", Int64.Type}, {"Name", type text}, {"Parameter", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each "Yes"),
#"Pivoted Column" = Table.Pivot(#"Added Custom", List.Distinct(#"Added Custom"[Parameter]), "Parameter", "Custom")
in
#"Pivoted Column"
- tgjones437 years agoHelper IV
Perfect, thank you so much Ashish_Mathur
- Ashish_Mathur7 years agoSuper User
You are welcome.