Forum Discussion

efhache's avatar
efhache
Frequent Visitor
4 years ago
Solved

creating matrix with average value multi groupped

Hi all,

Currently I've a table construct by merging other data sources.  In this table a part is interesting to have a view of staffing a team.
This table contains a date, an user id, a team, a work's period and a weekday.  Something like this :

 

table1

dateid_peopleteamshiftPeriodweekday
01/01/1970ABC_123A5-13Monday
01/01/1970XYZ_456B5-13Monday
01/01/1970DEF_456A5-13Monday
01/01/1970RST_789C13-21Monday
02/01/1970RST_789B13-21Tuesday
02/01/1970RST_789A5-13Wednesday
02/01/1970XYZ_456B13-21Wednesday
02/01/1970DEF_456A13-21Wednesday
02/01/1970GHJ_098D21-5Wednesday
03/01/1970ABC_123A21-5Thursday
03/01/1970XYZ_456A21-5Thursday
03/01/1970DEF_456B21-5Thursday
03/01/1970RST_789B5-13Thursday
03/01/1970ABC_987D13-21Thursday
03/01/1970QSD_345C21-5Thursday
03/01/1970LMP_765C13-21Thursday
03/01/1970KJH_592C13-21Thursday
03/01/1970BBN_886C21-5Thursday
04/01/1970ABC_123A13-21Friday
04/01/1970BBN_886B21-5Friday
04/01/1970LMP_765C13-21Friday
...............



My goal is to obtain a matrix view where columns show the team, and in each row I get the average number of people group by work's period and by week day.

Something like that :


Im' blocked and don't know how I can attack this problem.  Not a problem to create a matrix with a total, but here I'd like the average for each weekday based on all the same weekday in the showing year.

How can I solve it?

a verry thanks to who can help me

  • efhache , try measure like

    averageX(Sumamrize(table, Table[weekday], "_1", count(Table[id_people])), [_1])

3 Replies

  • efhache , try measure like

    averageX(Sumamrize(table, Table[weekday], "_1", count(Table[id_people])), [_1])

    • efhache's avatar
      efhache
      Frequent Visitor

      Thans amitchandak for the reply, but each row is a total, not an average.  And I want to get the average of present people for a monday, regardin all the monday of the year.   
      So if we consider One monday on three is 4 peoples and other is 1... the value must be something like 1.98 people... and not 103...

      • efhache's avatar
        efhache
        Frequent Visitor

        finally gain what I need by adding the number of week for the period.  Thanks a lot