• I was rereading your original question, and I need some more info.

    You said first you would like to have a count of how many machines have a value over 80%. (What is a machine btw, is it viewReportMonitorCounterLog.ComputerName?)

    Buy you also want to calculate the average. Over all the machines? Or over viewReportMonitorCounterLog.[Counter Instance]? Does [Counter Instance] have multiple rows in the data set?

    Maybe you can give some sample data and your desired output.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP