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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
dom-mitchell
Frequent Visitor

Create Headcount Table based on Start and End Date

Hi there, I'm struggling with a key element of a report for my HR group. 

 

I have a data set ('Attrition Report') which contains two key columns, [Start Date] and [End Date].

I order to create some key measures, I need to use that data to create a table that can show me a month by month headcount number. I believe once I have that I can use the DATEDIFF functon to work out a rolling 12 month average. 

I'm stuck at the new table creation stage however; I can't even think how to get started on it!

I'm guessing I need to perform some sort of COUNT function but I'm probably way off!

By desired output would be a table that looks something like this:

MonthHeadcount
Jan-201864
Feb-201864
Mar-201867
Apr-201866
May-201868

etc....

 

I know I need the calculated column to look at 'Attrition Data'[Start Date] and count if it is before the month and ignore if there is an [End Date] also before the month.

The [End Date] field is blank is someone is still employed. 

Any help on this would be much apprecaited!  

1 ACCEPTED SOLUTION
dom-mitchell
Frequent Visitor

I finally managed to find a solution and after multiple attempts at it not working (I had a tiny syntax error in my Dax), I managed to get the tips in this YouTube video to work for me:

Power BI Abstract Thesis Episode 65: Average of Rolling, Average of Snapshots - YouTube

Thanks to @amitchandak and the link over at Solved: calculate average headcount & attrition - Microsoft Power BI Community

View solution in original post

1 REPLY 1
dom-mitchell
Frequent Visitor

I finally managed to find a solution and after multiple attempts at it not working (I had a tiny syntax error in my Dax), I managed to get the tips in this YouTube video to work for me:

Power BI Abstract Thesis Episode 65: Average of Rolling, Average of Snapshots - YouTube

Thanks to @amitchandak and the link over at Solved: calculate average headcount & attrition - Microsoft Power BI Community

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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