Forum Discussion
Anonymous
3 years agoNot applicable
Pivot removes valueColumn
Hello When I use the Table.Pivot method, the valueColumn is not contained in the output. How can I retain it without having to duplicate it first? So, imagine my raw data is: Name, Attrib...
- 3 years ago
Hi Anonymous
Try this instead:
= Table.Pivot(#"etc", List.Distinct(#"etc"[Attribute]), "Attribute", "Attribute", List.Count)The "valueColumn" specified in the 4th argument of Table.Pivot is always removed from the resulting table.
So if you use "Attribute" there (which is removed anyway as it is also the "attributeColumn"), then as long as counting values in the Attribute column gives the correct result, this should give the correct pivoted table.
Regards,
OwenAuger
Super User
3 years agoHi Anonymous
Try this instead:
= Table.Pivot(#"etc", List.Distinct(#"etc"[Attribute]), "Attribute", "Attribute", List.Count)
The "valueColumn" specified in the 4th argument of Table.Pivot is always removed from the resulting table.
So if you use "Attribute" there (which is removed anyway as it is also the "attributeColumn"), then as long as counting values in the Attribute column gives the correct result, this should give the correct pivoted table.
Regards,