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

Calculating Averages when using a Calculate and Filter Measure

$
0
0

Hello, I'm having a little trouble figure out what is the best way to express my average over the course of 3 years using Measures.

 

My data structure looks like this (Table 1). As a note, there are other more unique data-elements (not illustrated below) that won't allow for this Table to be summerized/grouped to a higher level.

FullName  | Hours Worked | Location 1 | Location 2 | Labor Category  | Fiscal Year
John Smith| 10           | ABC        | ABC        | Worker          |  2015
John Smith| 5            | XYZ        | XYZ        | Manger          |  2014
John Smith| 7            | XYZ        | XYZ        | Manger          |  2015
John Smith| 3            | ABC        | CDA        | Worker          |  2013
John Smith| 2            | XYZ        | XYZ        | Manger          |  2015
John Smith| 10           | ABC        | ABC        | Worker          |  2015
John Smith| 5            | XYZ        | XYZ        | Manger          |  2014
John Smith| 7            | XYZ        | XYZ        | Manger          |  2015
John Smith| 3            | ABC        | CDA        | Worker          |  2013
John Smith| 2            | XYZ        | XYZ        | Manger          |  2015

My Measure looks like this:

Avg Hrs per Person = CALCULATE(SUM(Table1[Hours Worked])/DISTINCTCOUNT(Table1[FullName]
), Filter(Table1, [FullName]<>"No Matching Name" && [Location 1]=[Location 2] && ([Labor Category] = "Worker"|| [Labor Category]="Manager")))

Because John Smith was an employee for 3 years and his name remained the same the distinct count of John Smith is always 1 not 3. Now the problem is that I want this measure to represent the average of 3 year's of averages for John Smith; aka an average of an avearage.

 

I believe that the solution here is to use some combination of AVERAGEX, VALUES, and/or SUMMARIZE but the solution is illuding me.

 

I've tried creating 3 separate measures (one for each Fiscal Year) but I don't see and easy way to average the result of 3 separate measrues. Also, I've been reading a bit on how Averaging Averages is not the best course of action here, kindly advise if there is a better route. Thanks in advance and let me know if you need any more detail.


Viewing all articles
Browse latest Browse all 213889

Trending Articles



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