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
ctien
New Member

Advanced Power Query - Group by dataset including Start Date and End Date

HI,

 

I have below Source dataset 

 

Source data
Employee IDFunctionStart DateEnd DateDays
A001PM2024-01-012024-01-3131
A001PM2024-02-012024-02-1515
A001Consultant2024-02-162024-02-2914
A001PM2024-03-012024-03-3131
A001Consultant2024-04-012024-04-3030
    121

 

And i was hoping to produce the below summary 

 

 

Target summary
Employee IDFunctionStart DateEnd DateDays
A001PM2024-01-012024-02-1546
A001Consultant2024-02-162024-02-2914
A001PM2024-03-012024-03-3131
A001Consultant2024-04-012024-04-3030
    121

 

 

 

when using Group by function for Employee ID and Function  with min for start date and max for end date.  I got the below summary which is not correct.

 

Group by Emplee ID and Function. - Incorrect Summary
Employee IDFunctionStart DateEnd DateDays
A001PM2024-01-012024-03-3191
A001Consultant2024-02-162024-04-3075
   Incorrect

166

 

Does any expert have any good solution?   Many thanks in advance.

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Try adding the final parameter for the Table.Group function. Before the end parentheses, add ", GroupKind.Local".

 

--Nate

View solution in original post

2 REPLIES 2
ctien
New Member

Hi Nate,  Many thanks for your prompt response.   i works perfectly.  Calvin

Anonymous
Not applicable

Try adding the final parameter for the Table.Group function. Before the end parentheses, add ", GroupKind.Local".

 

--Nate

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.

Top Solution Authors