Forum Discussion

jcmartin01's avatar
jcmartin01
New Member
3 years ago
Solved

Pivot - Several lines for the same pivot.

Hello everybody 😉 I try to pivot this table :   QMNUM - MNCOD - ERLDAT 207514 - XXX - 08/11/2010 207515 - XXX - 15/04/2011 207515 - XXX - 30/08/2011 207516 - XXX - 15/09/2011   but I get an...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi jcmartin01 ,

     

    Select 'Don't' Aggregate' in the advanced options. The error will disappear.

    Testing M codes:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwNzU0UdJRioiIAJJGBoYGuoaGuhZKsTpQSVNkSUNdE12gCC5JC11jA4SkGaqkJVhnLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [QMNUM = _t, MNCOD = _t, ERLDAT = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"QMNUM", Int64.Type}, {"MNCOD", type text}, {"ERLDAT", type date}}),
        #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[MNCOD]), "MNCOD", "QMNUM")
    in
        #"Pivoted Column"

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.