Average YTD Headcount with PowerPivot/DAX

jdorby

New Member
Joined
Jul 28, 2014
Messages
19
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

ChildMonthNameShortTotal Avg YTD HC
S1110 - Salaried HeadsJan115.00
S1110 - Salaried HeadsFeb119.00117.00
S1110 - Salaried HeadsMar122.00118.67
S1110 - Salaried HeadsApr126.00120.50
S1110 - Salaried HeadsMay127.00121.80
S1110 - Salaried HeadsJun129.00123.00
S1110 - Salaried HeadsJul131.00124.14
S1110 - Salaried HeadsAug131.00125.00
S1110 - Salaried HeadsSep131.00125.67

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,214,527
Messages
6,120,054
Members
448,940
Latest member
mdusw

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