Forum Discussion

minapot's avatar
minapot
Frequent Visitor
8 years ago
Solved

Avg Hrs Worked

Hi! Need help please on the following calculation that I need to translate to PBI. Here's what I got in Excel.                                   I need to be able to compute f...
  • danextian's avatar
    danextian
    8 years ago

    Hi minapot,

     

    Try this:

     

    Avg =
    IF (
        HASONEVALUE ( table[emp_id] ),
        DIVIDE ( SUM ( table[total hrs worked] ), COUNT ( table[wknum] ) ),
        DIVIDE (
            DIVIDE ( COUNT ( table[wknum] ), [measure to divide] ),
            DISTINCTCOUNT ( table[emp_id] )
        )
    )

    Replace the text in red with the appropriate measure since you did not mention which column to divide the count of weeks by for the average.