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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Average Head Count of department/Employee over an year and month

Hello Everyone,
Greetings!
I was asked to find the Average head count of a department/employee in a Project across the year and month
I have the "Employee" table as below 

Venu787_2-1663067635686.png

 

 

 

I created an a calculated column [pdpt] (Concatenating the project,department, position and type of staff) in the "Employee Table" and also created two additional tables using the summarize function named "Summary Table" and "Connection Table".


"Summary Table" 

 Summary = SUMMARIZE('Employee Table','Employee Table'[Corp Ops],'Employee Table'[Department Code],'Employee Table'[Department Name],'Employee Table'[Function - Copy],'Employee Table'[Project Name],'Employee Table'[Location],'Employee Table'[Function],'Employee Table'[Project Type Description],'Employee Table'[Type of Staff],'Employee Table'[Position],'Employee Table'[PDPT],'Employee Table'[Name],'Employee Table'[Position - Copy.1]"Average Head Count" , AVERAGE('Employee Table'[Head Count]))

Connection Table
Connection Table = Summarize('Employee Table','Employee Table'[PDPT])




Summary[PDPT] --> Connection Table[PDPT] (Many to one, single direction)      
'Employee Table'[PDPT] --> Connection Table[PDPT] ( many to one, bi directional)


After all of this, my report is failing to generate a correct trend by year and month. I would like calculate the average over a year and month for all the employees. Could you please help me with this?







 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The below DAX helped me to solve it
Average Head Count = Sumx(Distinct[pdpt]), CALCULATE(AVERAGE('vw_CBIP_ManPowerPlan (2)'[Head Count])))

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

The below DAX helped me to solve it
Average Head Count = Sumx(Distinct[pdpt]), CALCULATE(AVERAGE('vw_CBIP_ManPowerPlan (2)'[Head Count])))

mahoneypat
Microsoft Employee
Microsoft Employee

You shouldn't need calculated columns or calculated tables for this one. Just create a measure like this one. It gives the average HC for the distinct combination of department, project, month, and year in the current context.

 

Avg HC Project Dept Month Year =
AVERAGEX (
SUMMARIZE (
'vw_CBIP_ManPowerPlan (2)',
'vw_CBIP_ManPowerPlan (2)'[Department Code],
'vw_CBIP_ManPowerPlan (2)'[Project Name],
'vw_CBIP_ManPowerPlan (2)'[month],
'vw_CBIP_ManPowerPlan (2)'[Year],
"cHC", SUM ( 'vw_CBIP_ManPowerPlan (2)'[Head Count] )
),
[cHC]
)

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


amitchandak
Super User
Super User

@Anonymous , You need  a measure like

 

Averagex(Values(Date[Month Year]), calculate(Sum(Table[Head Count])) )

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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
Anonymous
Not applicable

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

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.