Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Weekly Network Average Hours DAX

Hi,

 

I need a measure to return the weekly network average hours. My data includes these columns: Store, Employee ID, Week and Hours.

The dax measure should return the average of hours worked for all stores and employees by week. 

 

I'm using this measure: 

Weekly Hrs Avg = CALCULATE(AVERAGE(LsamDetail[Hours]), ALLEXCEPT(LsamDetail, LsamDetail[WeekNum], LsamDetail[W Dept]))

however it is returning the wrong average and it does not change when i slice by different months.

 

Help please?

 

This is an example of the output i want:

 

StoreIDWeekHoursWeekly Average
A11/5/202045.6
A21/5/202065.6
B31/5/202045.6
B41/5/202055.6
C51/5/202075.6
C61/5/202085.6
D71/5/202075.6
D81/5/202065.6
E91/5/202045.6
E101/5/202055.6
A11/12/202055.9
A21/12/202065.9
B31/12/202055.9
B41/12/202085.9
C51/12/202045.9
C61/12/202075.9
D71/12/202065.9
D81/12/202055.9
E91/12/202075.9
E101/12/202065.9

 

 

 

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

     

    Averageweekly = CALCULATE(AVERAGE('Table'[Hours]),ALLEXCEPT('Table','Table'[Week]))
     
     
     

    Regards,
    Harsh Nathani

    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

     

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Averageweekly = CALCULATE(AVERAGE('Table'[Hours]),ALLEXCEPT('Table','Table'[Week]))
     
     
     

    Regards,
    Harsh Nathani

    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

     

     
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hola Harsh,

      Marke to answer as a solution. Thanks a lot.

      Thalia