Forum Discussion

Incamus's avatar
Incamus
Regular Visitor
3 years ago
Solved

Index with repeated values

Dear all, good afternoon. Can you help me with this problem?   Table with the code used:     let Fonte = BD_Geral, #"Outras Colunas Removidas" = Table.SelectColumns(Fonte,{"Nº CTe", "No...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Incamus ,

    Please refer the steps below.

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUpMVIrViVYyQjCNEUwTIDMpCc5MTgYzTYHMlBQw0wzITE2FM9PS4MyMDKXYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Nº Cte" = _t, #"Contagem de Tranportadoras.Nome" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Nº Cte", Int64.Type}, {"Contagem de Tranportadoras.Nome", type text}}),
        #"Grouped Rows" = Table.Group(#"Changed Type", {"Nº Cte"}, {{"Data", each Table.AddIndexColumn(_, "Index", 0, 1, Int64.Type)}}),
        #"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"Contagem de Tranportadoras.Nome", "Index"}, {"Contagem de Tranportadoras.Nome", "Index"})
    in
        #"Expanded Data"

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum