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

View all the Fabric Data Days sessions on demand. View schedule

Reply
DBricklin1979
Regular Visitor

Need help to combine all the rows from several colums into one new colum

Hi,

 

I need help to combine all the rows from several colums into one new colum in Power Query. Is there a simple way. If I were to use Excel I would just copy and past but I am trying to see if I can save some time using Power Query instead. Please see example below.

DBricklin1979_0-1661282332326.png

 

Thanks in advance for any help given! 

1 ACCEPTED SOLUTION
davehus
Memorable Member
Memorable Member

Hi @DBricklin1979 ,

 

Please find a solution below.

 

Did I help you today? Please accept my solution and hit the Kudos button.

View solution in original post

6 REPLIES 6
unhinged
Frequent Visitor

 

//First one
let
    Source = Excel.CurrentWorkbook(){0}[Content],
    Index = Table.AddIndexColumn(Source, "Index", 0, 1, Int64.Type),
    Unpivot = Table.SelectColumns(Table.UnpivotOtherColumns(Index, {"Index"}, "Kolumn", "Value"), {"Value"})
in
    Unpivot
//Second one
let
    Source = Excel.CurrentWorkbook(){0}[Content],
    ColNames = Table.ColumnNames(Source),
    acc = List.Accumulate(ColNames,
                 {},
                 (state,current)=> List.Combine({
                                            state,          
                                            List.Transform(Table.Column(Source, current), (value) => Text.From(value))
                                                })
    ),
    tbl = Table.FromList(acc)
in
    tbl

 

Thanks @unhinged ! I am sure your solution works but I did already manage with the previously presented solution from devehus. Thanks anyway!

davehus
Memorable Member
Memorable Member

Hi @DBricklin1979 ,

 

Have you go PowerBI installed on your machine? You can used the code generated through powerquery in excel.

I have not been using PowerBi before but now I tried and used the steps from your file. It solved my problem. Thanks @davehus 

davehus
Memorable Member
Memorable Member

Hi @DBricklin1979 ,

 

Please find a solution below.

 

Did I help you today? Please accept my solution and hit the Kudos button.

Thanks @davehus ! But I am not sure how to use the BI-file you sent me. Can I open it in Excel?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.