Try this one
Get-VM | where {$_.PowerState -eq "PoweredOn"} |
Select Host, Name, NumCpu, MemoryMB,
@{N="Cpu.UsageMhz.Average";E={[Math]::Round((($_ | Get-Stat -Stat cpu.usagemhz.average -Start (Get-Date).AddHours(-72) -IntervalMins 5 -MaxSamples (12) | Measure-Object Value -Average).Average),2)}},
@{N="Mem.Usage.Average";E={[Math]::Round((($_ | Get-Stat -Stat mem.usage.average -Start (Get-Date).AddHours(-72) -IntervalMins 5 -MaxSamples (12) | Measure-Object Value -Average).Average),2)}} | `
Export-Csv "C:\VM-stats.csv" -NoTypeInformation -UseCulture
Don't forget the back-tick on the 2nd to last line !