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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.