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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.