Forum Discussion

PedroAliança's avatar
PedroAliança
Frequent Visitor
3 years ago
Solved

custom column to compare standard

Hello, everone.  I use a lot of DAX to handle data and I'm gradually migrating to M.  This time I'm trying to format all clients that start with the first 10 digits of the CNPJ with the same na...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi PedroAliança ,

     

    You want the following calculations to be listed in Power Query, right?

    Here's the solution in Power Query.

    1.Add a custom column to return the first ten characters starting from the left.

    2.Add an index column.

    3.Group by the [LEFT10] and set up as follows.

    4.Expand the All Rows column

    5.Add a conditional column to compare.

    6.Fill up the column.

     

    7.Sort based on the index column and the [Custom] column is the result.

     

     

    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.