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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.