Search code examples
powerbidaxaverage

Find average for column all except current value


I have data like this where every row is a task that certain employee completed and how much time it took them. | employee | minutes | | -------- | -------- | emp1 35
emp1 65 emp2 200
emp1 15 emp3 5
emp1 55 emp1 24
emp3 2

What I have:

I've made a table visual with each employee and their average minutes like this

emp1 38.8
emp2 200 emp3 3.5

What I need:

I would like another column that shows what the average would be without this particular employee's rows such as:

emp1 38.8 5 (average of all the values except Emp1's) emp2 200 38.8 emp3 3.5 65.7

And if possible another column that shows the percentage effect, like this employee made the average increase by x% or decrease by y%, etc. I feel like I have tried everything and I can't figure it out. Thank you in advance

I've tried a bunch of formulas using ALL, ALLEXCEPT, FILTER. I don't have a good enough understanding to write this


Solution

  • Try these below 2 measure-

    avg_other = 
    CALCULATE(
        AVERAGE(employee_timing[minutes]),
        FILTER(
            ALL(employee_timing),
            employee_timing[employee] <> MIN(employee_timing[employee])
        )
    )
    

    and

    avg_effect = (AVERAGE(employee_timing[minutes]) - [avg_other])/[avg_other]
    

    here is the output-

    enter image description here