Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 217217

YTD Average with Slicers

$
0
0

Hi!

 

I have a table with Headcount and People Costs by month for three organizations.  I am trying to create a measure that calculates the YTD average headcount that works with a slicer for organization.  An example of the data is below.

 

Fiscal MonthOrganizationValuesActual
JanuarySharedHeadcount5
JanuaryPremierHeadcount10
JanuaryMCSHeadcount15
FebruarySharedHeadcount6
FebruaryPremierHeadcount11
FebruaryMCSHeadcount16
JanuarySharedPeople Cost500
JanuaryPremierPeople Cost1000
JanuaryMCSPeople Cost1500
FebruarySharedPeople Cost600
FebruaryPremierPeople Cost1100
FebruaryMCSPeople Cost1600

 

The measure I have written is

Actual YTD HC Avg = TOTALYTD( CALCULATE( AVERAGE( 'AAD CPH'[Actual] ) , 'AAD CPH'[Values] = "Headcount" ) , 'Calendar'[Fiscal Month] , "06/01/2017" )

 

*Calendar is my date table and is mapped to my fiscal month through a mapping table*

 

It works fine when I have a single organization selected in my slicer.  For example, February YTD HC Avg for Shared is returning 5.5 ( Average of 5 & 6). 

 

However, when I select all organizations in the slicer to show the Total, I get 10.5 instead of the expected 31.5 (Average of 30 & 33).  I know it's calculating the average of all 6 numbers to get 10.5, but I don't know how to write the formula to cumulate the numbers within a fiscal month before taking the average.


Viewing all articles
Browse latest Browse all 217217

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>