Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
FalkoKoehler
New Member

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

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
Skilled Sharer
Skilled Sharer

Hi @FalkoKoehler,

 

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

 

Highlight two columns and click right button on your mouse, and select Unpivot columnsHighlight two columns and click right button on your mouse, and select Unpivot columnsResultResult

 

Regards

Abduvali

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?

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.

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

@FalkoKoehler well-done mate!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.