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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Cottswald
New Member

Is it Possible to Merge 2 Columns into 1 (by creating new rows)

I have reports automatically emailed to me from my company server. I currently do transformation in Excel, but am looking to get the process setup in PowerBI for automation.

My problem is that the reports are sent in this format, and I cannot change them:

NameType 1Type 2Type 3Type 4Type 5


I would like to use a query in BI to transform the data to this:

NameType 1
NameType 2
NameType 3
NameType 4
NameType 5


I have not been able to find a soultion anywhere to this. Pivoting & un-pivoting columns doesn't do what I am trying to do.
I am trying to merge all my 'Type' columns into a single column, essentially adding it as additional rows to an exisitng column.
Is this even possible in PowerBI? Any suggestions would be greatly appreciated!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Cottswald ,

I created a sample pbix file(see the attachment), please check if that is what you want.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("RcqhDcNAEETRXg4b5GZnbFfhBqwDAYFh6V+Rviwteejd97je389rjm38JgoLjZljbU8UEYWFxqhjEVFYaEx1NBGFhca4Y4goLDQmHXciCguN2TseRBQWGnN0PIkoLDTmHGv9AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, #"Type 1" = _t, #"Type 2" = _t, #"Type 3" = _t, #"Type 4" = _t, #"Type 5" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Type 1", type text}, {"Type 2", type text}, {"Type 3", type text}, {"Type 4", type text}, {"Type 5", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name"}, "Types", "Value"),
    #"Merged Columns" = Table.CombineColumns(#"Unpivoted Other Columns",{"Name", "Types"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged")
in
    #"Merged Columns"

yingyinr_0-1675839837106.png

Best Regards

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Cottswald ,

I created a sample pbix file(see the attachment), please check if that is what you want.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("RcqhDcNAEETRXg4b5GZnbFfhBqwDAYFh6V+Rviwteejd97je389rjm38JgoLjZljbU8UEYWFxqhjEVFYaEx1NBGFhca4Y4goLDQmHXciCguN2TseRBQWGnN0PIkoLDTmHGv9AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, #"Type 1" = _t, #"Type 2" = _t, #"Type 3" = _t, #"Type 4" = _t, #"Type 5" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Type 1", type text}, {"Type 2", type text}, {"Type 3", type text}, {"Type 4", type text}, {"Type 5", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name"}, "Types", "Value"),
    #"Merged Columns" = Table.CombineColumns(#"Unpivoted Other Columns",{"Name", "Types"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged")
in
    #"Merged Columns"

yingyinr_0-1675839837106.png

Best Regards

I was looking for a way to do this too and i came across your solution! Thanks so much. It was exactly what I needed. 

FreemanZ
Super User
Super User

hi @Cottswald 

try to paste some dummy but concrete data?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors