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
bigrods
Helper II
Helper II

Summary Table - Headcount on Last Day and New Starters across Month

Hi,

 

I wondered if anyone could help; I would like to summarize a table of employee headcount and new starters. The table should display the following 3 columns:

 

Month NameHeadCountNew Starters
   

 

However, the Head count should be taken as at the figure on the final day of each month, and the New Starters should be a sum of all the new starters across each month.

 

I have a 'Calendar' date table, this also has 2 calculated columns in:

Timeframe - to identify if the date is in the last 12 months

LastDay - to identify if the date is the last date in the month

 

Calendar Table

bigrods_0-1731578001697.png

 

I also have a HeadCount Dataset table; this lists:

 

Employee Number

Latest Start Date

Asg Effective End Date

 

I have also created 2 measures, I wondered if it was possible to fit these in to the table?

 

HeadCount Measure:

bigrods_1-1731578057387.png

 

New Starters Measure:

bigrods_2-1731578099855.png

 

I am struggling with how to get a mix of - last day of the month and a sum across the month - if anyone could please help that would be much appreciated!

 

Many thanks

 

1 ACCEPTED SOLUTION

Thanks - I have managed to solve myself, I had a Date table that listed each day "01-Apr", "02-Apr", "03-Apr" etc.

This was causing me the headache but I solved it by adding a new calculated column of FORMAT('calendar'[Date],"mmm-yy").

This then let me create the Summarized table that calculates the Headcount, New Starters and Leavers for each month!

 

Headcount Summary = SUMMARIZE('calendar','calendar'[DateMonth],"HeadCount",CALCULATE(DISTINCTCOUNT('Headcount Dataset'[Employee Number]),
    FILTER('Headcount Dataset','Headcount Dataset'[Latest Start Date] <= MAX('calendar'[Date]) && ('Headcount Dataset'[Asg Effective End Date] >= min('calendar'[Date]) || ISBLANK('Headcount Dataset'[Asg Effective End Date])) && ('Headcount Dataset'[termination] >=MIN('calendar'[Date]) || ISBLANK('Headcount Dataset'[termination])))),"New Starters",CALCULATE(DISTINCTCOUNT('Headcount Dataset'[Employee Number]),
    FILTER(VALUES('Headcount Dataset'[Latest Start Date]),'Headcount Dataset'[Latest Start Date] <= MAX('calendar'[Date]) && 'Headcount Dataset'[Latest Start Date] >= MIN('calendar'[Date]))),"Leavers",CALCULATE(DISTINCTCOUNT('Headcount Dataset'[Employee Number]),
    FILTER(VALUES('Headcount Dataset'[Termination]),'Headcount Dataset'[termination] <= MAX('calendar'[Date]) && 'Headcount Dataset'[termination] >= MIN('calendar'[Date]))))

View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

pls provide some sample data of headcount table and the expected output





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks - I have managed to solve myself, I had a Date table that listed each day "01-Apr", "02-Apr", "03-Apr" etc.

This was causing me the headache but I solved it by adding a new calculated column of FORMAT('calendar'[Date],"mmm-yy").

This then let me create the Summarized table that calculates the Headcount, New Starters and Leavers for each month!

 

Headcount Summary = SUMMARIZE('calendar','calendar'[DateMonth],"HeadCount",CALCULATE(DISTINCTCOUNT('Headcount Dataset'[Employee Number]),
    FILTER('Headcount Dataset','Headcount Dataset'[Latest Start Date] <= MAX('calendar'[Date]) && ('Headcount Dataset'[Asg Effective End Date] >= min('calendar'[Date]) || ISBLANK('Headcount Dataset'[Asg Effective End Date])) && ('Headcount Dataset'[termination] >=MIN('calendar'[Date]) || ISBLANK('Headcount Dataset'[termination])))),"New Starters",CALCULATE(DISTINCTCOUNT('Headcount Dataset'[Employee Number]),
    FILTER(VALUES('Headcount Dataset'[Latest Start Date]),'Headcount Dataset'[Latest Start Date] <= MAX('calendar'[Date]) && 'Headcount Dataset'[Latest Start Date] >= MIN('calendar'[Date]))),"Leavers",CALCULATE(DISTINCTCOUNT('Headcount Dataset'[Employee Number]),
    FILTER(VALUES('Headcount Dataset'[Termination]),'Headcount Dataset'[termination] <= MAX('calendar'[Date]) && 'Headcount Dataset'[termination] >= MIN('calendar'[Date]))))
Anonymous
Not applicable

Hi @bigrods ,

Glad to hear you've found a solution! If you're sure the issue has been resolved, could you mark this post as resolved? That way, others with similar issues can more easily find a solution and the community can see that the issue has been resolved.
Thanks, and feel free to reach out if you need further help!

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.