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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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