Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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...
  • OwenAuger's avatar
    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,