Forum Discussion

rchiang's avatar
rchiang
Frequent Visitor
8 years ago
Solved

Combining 2 columns into 1 new long column

Good Morning,

 

I'm currently trying to combine 2 columns with the same drop down options (so same text datasets) so I can use a visualization to see the total amount of times each categories were used. Each line is linked to the accounts those categories were featured at. 

 

So I want to be able to see 1 visualization with the accounts down 1 axis and the categories on the other axis. 

 

 

 

Thanks! 

  • Anonymous's avatar
    Anonymous
    8 years ago

    HI rchiang,


    Maybe you can try to use unpivot table feature to convert these columns to key and value columns, then remove duplicate records. After these steps, you will get merge records.

    Power Query Unpivot Scenario

     

    Regards,

    Xiaoxin Sheng

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI rchiang,

     

    You can try to use below formula to get merged unique list:

    NewTable =
    DISTINCT (
        UNION ( VALUES ( 'Table'[Product1] ), VALUES ( 'Table'[Product2] ) )
    )
    

     

    Regards,

    Xiaoxin Sheng

    • rchiang's avatar
      rchiang
      Frequent Visitor

      Hi AnonymousXiaoxin,

       

      Thank you for your help for that.

       

      I should have showed the actual table I want combined

       

      I want to have 1 column that will show the account with category .

       

      So it would be 

      Column 1 / Column 2 

      PCM US / Docks and Hubs

      PCM US / Racks and Enclosures 

       

      Thanks again! 

      Would that be possible? 

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI rchiang,


        Maybe you can try to use unpivot table feature to convert these columns to key and value columns, then remove duplicate records. After these steps, you will get merge records.

        Power Query Unpivot Scenario

         

        Regards,

        Xiaoxin Sheng