cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
FalkoKoehler Frequent Visitor
Frequent Visitor

merge two columns of one table in a new table

Hi All,

 

i am looking for a way to merge two columns of one table in a new table for the following example:

 

Table:

ID     Employees Dpt1     Employees Dpt2

543        12                                 11

323         4                                  22

 

New table should be:

ID          Dpt         Employees

543       Dpt1              12

543       Dpt2              11

323       Dpt1              4

323       Dpt2              22

 

Thanks a lot for your help :)!

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
Abduvali Established Member
Established Member

Re: merge two columns of one table in a new table

Go back to Edit mode and instead of using Summarize try using Duplicate Table and perform all transformations within that duplicate table. 

 

That might do the trick for you.

View solution in original post

5 REPLIES 5
Abduvali Established Member
Established Member

Re: merge two columns of one table in a new table

Hi @FalkoKoehler,

 

You need to use Unpivot function in power bi edit query mode:

 

Capture16.PNGHighlight two columns and click right button on your mouse, and select Unpivot columnsCapture17.PNGResult

 

Regards

Abduvali

FalkoKoehler Frequent Visitor
Frequent Visitor

Re: merge two columns of one table in a new table

Hi @Abduvali,

 

thanks for your reply. My source table needs to hav unique IDs so I cannot unpivot directly in the source table. So what i did is to create a new table with the summarize function (only leaving the relevant columns). The problem now is that the query moder is only available for imported/connected tables but not when they are created inside Power BI it seems - so i cannot find a way to unpivot this? 😞

 

Do you got a solution for this?

Abduvali Established Member
Established Member

Re: merge two columns of one table in a new table

Go back to Edit mode and instead of using Summarize try using Duplicate Table and perform all transformations within that duplicate table. 

 

That might do the trick for you.

View solution in original post

FalkoKoehler Frequent Visitor
Frequent Visitor

Re: merge two columns of one table in a new table

@Abduvaliyou were too fast i was just about to declare it as resolved as i got exactly you solution a second ago 😄

Abduvali Established Member
Established Member

Re: merge two columns of one table in a new table

@FalkoKoehler well-done mate!

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors