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
Anonymous
Not applicable

Average Headcount Calculation

I need to calculate average headcount 

 

Will need help in arrving at below number in power bi. My excel look this

 

MonthClosing HeadcountAvergae HC - Average function
Oct35853585
Nov35883586.5
Dec35953589.333
Jan36013592.25
Feb35813590
Mar36053592.5
Apr36133595.429
May36163598
Jun36723606.222
Jul37233617.9
Aug37493629.818
Sep37773642.083
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

1. you need to have a date column or year month column

 

2. you can create a column

Column = AVERAGEX(FILTER('Table','Table'[year month]<=EARLIER('Table'[year month])),'Table'[Closing Headcount])

1.PNG

 

or a measure

Measure = AVERAGEX(FILTER(all('Table'),'Table'[year month]<=max('Table'[year month])),'Table'[Closing Headcount])

2.PNG

pls see the attachment below





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

Proud to be a Super User!




View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Does the Financial Year run from October to September?  Also, share some data to work with (in a format that can be pasted in an MS Excel file.) or share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Yes we have fiscal year concept.

The solution worked which was provided on trail message.

 

Thanks!

ryan_mayu
Super User
Super User

@Anonymous 

1. you need to have a date column or year month column

 

2. you can create a column

Column = AVERAGEX(FILTER('Table','Table'[year month]<=EARLIER('Table'[year month])),'Table'[Closing Headcount])

1.PNG

 

or a measure

Measure = AVERAGEX(FILTER(all('Table'),'Table'[year month]<=max('Table'[year month])),'Table'[Closing Headcount])

2.PNG

pls see the attachment below





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

Proud to be a Super User!




Anonymous
Not applicable

Thanks , this worked

you are welcome





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

Proud to be a Super User!




Shaurya
Memorable Member
Memorable Member

Hi @Anonymous,

 

Use the following formula:

 

Average Headcount = SUMX('Table',IF('Table'[Month]<=EARLIER('Table'[Month]),'Table'[Closing],0)) / SUMX('Table',IF('Table'[Month]<=EARLIER('Table'[Month]),1,0))

 

Mark this post as a solution if that works for you!
Consider taking a look at my blog: How to Export Telemetry Data from Azure IoT Central into Power BI

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.