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
AnaAlbano
Helper I
Helper I

Monthly Average Headcount

Hello Community! 

 

I´m starting my DAX journey and I wonder if you could help with this question: I´m trying to calculate the average headcount considering the beginning of the month and end of the month, I have a new dataset included in the data base for each month, which I use the 'report date´field to indicate the period. For example, July 1, all the details per employee line and the same for July 31st.

 

AnaAlbano_0-1628844102065.png

How could I do it?

 

Thank you,

Ana

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @AnaAlbano 

 

Could you please consdier sharing more details about it or a simple sample file without any sesentive information  so that i may work out with a workaround?

 

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@AnaAlbano , for end of the month you can use closingbalancemonth with help from date table 

or try lastnonblankvalue and  firstnonblankvalue

 

example

calculate( lastnonblankvalue('Date'[Date], Sum(Table[Headcount])) + firstnonblankvalue('Date'[Date], Sum(Table[Headcount])) , allexpect(Table, Table[Month Year]))/2

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.