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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors