Average YTD Headcount with PowerPivot/DAX

jdorby

New Member
Joined
Jul 28, 2014
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

I have a fact table that is filled with multiple departments, with multiple headcount types (full time, part time, contractors, etc), spanning several years, at the MONTH LEVEL. Some of the months during the year can have 0 values as well. I am trying to write a formula that calculates the YTD Average HC and can't quite figure it out. I have a Date Table linked to my data set.

When calculating YTD Sales my formula works perfectly:
=Calculate([Actuals (OP2 Rate)],DATESYTD(calendar[date]))

where "Actuals (OP2 Rate)" =calculate(sum(Fact_OpexHC[Amount@OP2Rate]),Fact_OpexHC[Scenario] = "Actuals")

I thought just substituting Average or AverageX for Sum in the formula above would work, but it doesn't.

The first three columns below, Child, MonthNameShort, and Total show the headcount by month in my data model. What I want my Avg YTD HC calc to look like is the 4th column, Avg YTD HC, which I currently don't have in the model. Any help is greatly appreciated!! Thanks, Jim

[TABLE="width: 491"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Child[/TD]
[TD]MonthNameShort[/TD]
[TD]Total[/TD]
[TD] Avg YTD HC[/TD]
[/TR]
[TR]
[TD]S1110 - Salaried Heads[/TD]
[TD]Jan[/TD]
[TD="align: right"]115.00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]S1110 - Salaried Heads[/TD]
[TD]Feb[/TD]
[TD="align: right"]119.00[/TD]
[TD="align: right"]117.00[/TD]
[/TR]
[TR]
[TD]S1110 - Salaried Heads[/TD]
[TD]Mar[/TD]
[TD="align: right"]122.00[/TD]
[TD="align: right"]118.67[/TD]
[/TR]
[TR]
[TD]S1110 - Salaried Heads[/TD]
[TD]Apr[/TD]
[TD="align: right"]126.00[/TD]
[TD="align: right"]120.50[/TD]
[/TR]
[TR]
[TD]S1110 - Salaried Heads[/TD]
[TD]May[/TD]
[TD="align: right"]127.00[/TD]
[TD="align: right"]121.80[/TD]
[/TR]
[TR]
[TD]S1110 - Salaried Heads[/TD]
[TD]Jun[/TD]
[TD="align: right"]129.00[/TD]
[TD="align: right"]123.00[/TD]
[/TR]
[TR]
[TD]S1110 - Salaried Heads[/TD]
[TD]Jul[/TD]
[TD="align: right"]131.00[/TD]
[TD="align: right"]124.14[/TD]
[/TR]
[TR]
[TD]S1110 - Salaried Heads[/TD]
[TD]Aug[/TD]
[TD="align: right"]131.00[/TD]
[TD="align: right"]125.00[/TD]
[/TR]
[TR]
[TD]S1110 - Salaried Heads[/TD]
[TD]Sep[/TD]
[TD="align: right"]131.00[/TD]
[TD="align: right"]125.67[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top