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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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