Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Average per week

hi,

 

i want to calculate an average salary per week per employee.

NameWeekSalary
A160
B170
C150
D170
A180
B170
C180
A120
B160
C170
D150
A170
B180
C170

 

kind regards

  • Hi Framboosje,

     

    To achieve this, you can create a calculate column using DAX formula below:

    Result = CALCULATE(AVERAGE(Table1[Salary]), ALLEXCEPT(Table1, Table1[Name], Table1[Week]))

      

     

    Regards,

    Jimmy Tao

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    You can summarize that info in a new table:

     

    AverageperEmployee =
    SUMMARIZE (
        'Table',
        'Table'[Name],
        'Table'[Week],
        "Average Salary", AVERAGE ( 'Table'[Salary] )
    )

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks but  can this be done in a calculation instead of a new table?

      • Arentir's avatar
        Arentir
        Resolver III

        It looks to me you only need a simple measure:

        Average Salary = AVERAGE([Salary])

         

        In your table chart, you add Week, Employee and Average Salary. You will see your average per week per employee.

         

        Let me know if I missed something

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    Hi Framboosje,

     

    To achieve this, you can create a calculate column using DAX formula below:

    Result = CALCULATE(AVERAGE(Table1[Salary]), ALLEXCEPT(Table1, Table1[Name], Table1[Week]))

      

     

    Regards,

    Jimmy Tao