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
maivarss
Microsoft Employee
Microsoft Employee

Average headcount calculation

Hi,

 

I currently have a large dataset that includes both headcount and financial data over a 12 month period. The heacount is reflected as a number by area and month, and I would like include a measure calculating the average headcount for the period in question (where it is possible to change the period for the average headcount calculation based on what period I'm chosing). For all financial data, the headcount column displays 0, and thus I fail to succeed using an average calculation (even after trying various methods to filter out the 0s). Help would be greatly appreciated!

 

Thanks,

 

Malin

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

= CALCULATE(AVERAGE([Value]),[Value] > 0)

?

 

@maivarss



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks smoupre, didn't specify my question clearly 🙂 I tried your suggestion before, and this only gives me the average by the district in the regions (which is quite low as there are very many districts), which then doesn't roll up to e.g. a global headcount average for the month for ALL the districts combined. So I suspect I need to somehow include a sum in the average formula - any thoughts?

Can you give me some sample data and desired outcome?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Do you want the average to be the total headcount divided by the number of regions, rather than the number of districts? AVERAGE() will return SUM( 'Table'[Field] ) / COUNT( 'Table'[Field] ). If you want a different denominator, just use a SUM() measure over an alternate count:

 

HeadCount =
SUM( FactHeadCound[HeadCountAmount] )

Regions =
DISTINCTCOUNT( FactHeadCount[Region] )

Average HeadCount across Regions =
DIVIDE( [HeadCount], [Regions] )

You can obviously do similar for other denominators.

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.