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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
mithunt
Frequent Visitor

How to Merge data from multiple columns to one?

Hello Powerbians...

 

I need some assistance

I have created 5 Conditional Columns and want to merge all of them to one.

 

Col 1 - Shirt Size - S,M,L,XL,XXL, Other
Col 2 - Tshirt size - 38,40,42,44,Other

 

etc,

 

Output should look like


S
M
L
XL
XXL
38
40
42
44
Other

 

If the data is not matching in any of the columns, then it should be marked as Other

 

Thanks in Advance

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @mithunt 

 

Here is another solution you can try. 

Original table:

vjingzhang_0-1674022488445.png

Add a custom step: (#"Changed Type" is the previous step name) 

= Table.FromList(List.Select(List.Distinct(List.Combine(Table.ToColumns(#"Changed Type"))), each _ <> ""))

Result:

vjingzhang_1-1674022539176.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @mithunt 

 

Here is another solution you can try. 

Original table:

vjingzhang_0-1674022488445.png

Add a custom step: (#"Changed Type" is the previous step name) 

= Table.FromList(List.Select(List.Distinct(List.Combine(Table.ToColumns(#"Changed Type"))), each _ <> ""))

Result:

vjingzhang_1-1674022539176.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Mahesh0016
Super User
Super User

@mithunt 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WClbSUTK2UIrViVbyBTJNDMBMHxDTCMyMALNNIGwwx78kI7UIzIewdJSUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column 1" = _t, #"Column 2" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column 1", type text}, {"Column 2", type text}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Column 1] <> "Other")),
#"Transposed Table" = Table.Transpose(#"Filtered Rows"),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Transposed Table", {}, "Attribute", "Value")
in
#"Unpivoted Columns"


@mithunt If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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