Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Calculate Minimum Average after column value

Hi all, 

I' am doing a sport analysis in which i need to calculate an average of best efforts in specific sports drills. 

 

So, I'm looking towards caluating a average of minimum time spend on a drill after player_name.

=

Player_nameTotal_timeMinimum_timeAvg ((10+30)/2)
X x101020
X x201020
X x301020

Y y

303020
Y y403020
Y y503020

 

 

Cheers, 


/M

  • Please try this expression in your measure in a table visual with Player_Name (and any other columns).

     

    Avg Time =
    AVERAGEX (
        ALL ( Times[Player_name] ),
        CALCULATE (
            MIN ( Times[Total_time] ),
            ALLEXCEPT (
                Times,
                Times[Player_name]
            )
        )
    )

     

    Regards,

    Pat

4 Replies

  • Anonymous , Create a measure like

    averageX(values(Table[Player_name]), calculate(Min(Table[Total_time])))

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      Thanks for the effort! ๐Ÿ™‚

       

      That doesn't return a single AVG. The AVG varies row for row. It should be the same for the whole table as the AVG should be calculated for the whole table meaning AVG of minimum-time after player = ร“ne value for all rows, as they are subject to the same table avg.

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Please try this expression in your measure in a table visual with Player_Name (and any other columns).

     

    Avg Time =
    AVERAGEX (
        ALL ( Times[Player_name] ),
        CALCULATE (
            MIN ( Times[Total_time] ),
            ALLEXCEPT (
                Times,
                Times[Player_name]
            )
        )
    )

     

    Regards,

    Pat