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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
arnaudmanir
Frequent Visitor

Merging multiple rows into one based on date values

Hello. I'm new to Power Query and in dire need of some help here.

 

I'm in the auto finance industry and working on a table with thousands of serial numbers, corresponding funding date and payout date (if the loan is closed), all three listed in separate columns. You may have different rows with the same serial number if the asset was funded more than once.

 

I want a list of each asset that was financed more than once with columns showing the serial number, first advance date, first payout date, second advance date, second payout day, etc.?

 

I managed to filter for the serial numbers but the part I'm struggling with is merging multiple rows into one as described above.

1 ACCEPTED SOLUTION
ovde
Resolver II
Resolver II

Hi @arnaudmanir 

I think you want to look into using the table.group function. Table.Group - PowerQuery M | Microsoft Learn

When it comes to showing [second advance date], [second payout day] do you want to show these is separate columns? If so you might want to duplicate the relevant columns first and then use the group function with the correct aggregation to show the second or third etc. values. 

Hope this helps!

View solution in original post

2 REPLIES 2
ovde
Resolver II
Resolver II

Hi @arnaudmanir 

I think you want to look into using the table.group function. Table.Group - PowerQuery M | Microsoft Learn

When it comes to showing [second advance date], [second payout day] do you want to show these is separate columns? If so you might want to duplicate the relevant columns first and then use the group function with the correct aggregation to show the second or third etc. values. 

Hope this helps!

It helped immensely, thanks a bunch. I used min and max aggregate on the advance date column to filter for the initial and the latest advance date. To expand on that, how can I see dates in between those two dates? I know List.Min will show the first and List.Max the latter, but what about the in betweens? Hope I'm making sense.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.