Forum Discussion

Locco's avatar
Locco
Helper III
4 years ago
Solved

Merge names in a row

I need to merge names in a single row and I have been having trouble getting this to work. I would like to do this without using DAX and to have it in query but I am open to a DAX solution as well.

 

I have a column which lists three different machine names. I need to group two of the machines together.

 

Machine001

Machine002

Machine003

 

I would like a column to have 

 

Machine001 & Machine003

Machine002

 

I've tried various other similar solutions, but nothing is giving the expected result, or they just are not fit for my purpose.

 

Can anyone help me with this?

 

Thanks!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Locco ,

     

    Assume you have grouped the machines.

    First add an index column to the table.

    Then select the index column and use pivot feature.

    At last, merge the selected columns(under Add column tag) and delete unneeded columns.

     

    Best Regards,

    Jay

3 Replies

  • Locco what is the logic to combining machine 1 and machine 3?

     

     

    Follow us on LinkedIn and  to our YouTube channel

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

    • Locco's avatar
      Locco
      Helper III

      parry2k 

       

      The machines have a combined waste limit. So both machines together cannot exceed X amount of waste. I have no real way of splitting up the waste limit because it's not equally divided between the machines. If I group the machines on this table then their waste is combined and I can compare that against their limit. I have a seperate table with the waste limits and that table has the machines grouped. I figured the easiest option was to group the machines on this table and create a relationship between the two tables.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Locco ,

     

    Assume you have grouped the machines.

    First add an index column to the table.

    Then select the index column and use pivot feature.

    At last, merge the selected columns(under Add column tag) and delete unneeded columns.

     

    Best Regards,

    Jay