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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.