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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Recoba88
Helper III
Helper III

Aggregate 2 different columns in power query

Hi,

 

How can I aggregate these coulmns together ?

 

CHECK0909.PNG

 

Column1          Coulmn 2

Header 1          Data 1

Header 2          Data 2

Header 3          Data 3 

Header 4          Data 4 

Header 5          Data 5 

Header 7          Data 7

Header 8          Data 8

Header 10        Data 10

 

1 ACCEPTED SOLUTION

This would be the correct code (note: you use Column5, not Column4):

 

= Table.FromColumns({List.RemoveNulls(Source[Column1])&List.RemoveNulls(Source[Column3]),List.RemoveNulls(Source[Column2])&List.RemoveNulls(Source[Column5])})
Specializing in Power Query Formula Language (M)

View solution in original post

3 REPLIES 3
MarcelBeug
Community Champion
Community Champion

Post removed as it was incorrect.

Specializing in Power Query Formula Language (M)

This would be the correct code (note: you use Column5, not Column4):

 

= Table.FromColumns({List.RemoveNulls(Source[Column1])&List.RemoveNulls(Source[Column3]),List.RemoveNulls(Source[Column2])&List.RemoveNulls(Source[Column5])})
Specializing in Power Query Formula Language (M)
Anonymous
Not applicable

I would create two separate queries - one for columns 1 and 2; the other one - for column 3 and 5.

I would do some cleansing: Remove Empty values

I would give them Header and Data column names.

Then I would use Append Queries option

Hope this works

Michael

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors