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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Combining text across columns

Thank you in advance for your help. If I have 2 columns of data (both text), 20 rows, and I want to move column 2 row 11-20 to column 1 row 11-20, (replacing what currentely exists in column 1 row 11-20) how would I do that? Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

You can easily achieve this by adding an Index Column and then adding a New Conditional Column. 

 

Using the code below you will get the following result.

 

Annotation 2019-11-22 181653.png

 

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column 1", type text}, {"Column 2", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1),
    #"Added Custom" = Table.AddColumn(#"Added Index", "Solution", each if [Index]<11 then [Column 1] else [Column 2]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Solution", type text}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Index"})
in
    #"Removed Columns"

 

Hope it helps.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi,

 

You can easily achieve this by adding an Index Column and then adding a New Conditional Column. 

 

Using the code below you will get the following result.

 

Annotation 2019-11-22 181653.png

 

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column 1", type text}, {"Column 2", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1),
    #"Added Custom" = Table.AddColumn(#"Added Index", "Solution", each if [Index]<11 then [Column 1] else [Column 2]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Solution", type text}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Index"})
in
    #"Removed Columns"

 

Hope it helps.

Anonymous
Not applicable

Got it! Thank you so much! I appreciate it.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.