Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
Whenever i run the below scrip the data in BI dashboard keeps incrementing. Example - ESX Host - 5 then it increments to 10 Host and VM's - 61 to 122. How to fix this in power BI.
Any pointers will be much appreciated.
eport = foreach ($vCenter in $vCenters) {
Connect-VIServer $vCenter -Protocol https
}
$date = Get-Date
foreach($cluster in Get-Cluster){
$esx = $cluster | Get-VMHost
$cluster | Select @{N="DCname";E={(Get-Datacenter -Cluster $cluster).Name}},
@{N="Clustername";E={$cluster.Name}},
@{N="Total Physical Memory (GB)";E={($esx | Measure-Object -Property MemoryTotalGB -Sum).Sum}},
@{N="Configured Memory GB";E={($esx | Measure-Object -Property MemoryUsageGB -Sum).Sum}},
@{N="Available Memory (GB)";E={($esx | Measure-Object -InputObject {$_.MemoryTotalGB - $_.MemoryUsageGB} -Sum).Sum}},
@{N="Num of CPUs)";E={($esx | Measure-Object -Property NumCpu -Sum).Sum}},
@{N="Total CPU (Mhz)";E={($esx | Measure-Object -Property CpuTotalMhz -Sum).Sum}},
@{N="Configured CPU (Mhz)";E={($esx | Measure-Object -Property CpuUsageMhz -Sum).Sum}},
@{N="Number of VMs";E={($esx | Get-VM).count}},
@{N="Number of ESXi Hosts";E={$esx.count}}
$endpoint = "https://api.powerbi.com/beta/a1f1e214-7ded-45b6-81a1-9e8ae3459641/datasets/808338b1-a3bf-4572-8496-b..."
$payload = @{
"Date" = $Date
"Available Memory (GB)" =($esx | Measure-Object -InputObject {$_.MemoryTotalGB - $_.MemoryUsageGB} -Sum).Sum
"Configured Memory GB" =($esx | Measure-Object -Property MemoryUsageGB -Sum).Sum
"Total Physical Memory (GB)" =($esx | Measure-Object -Property MemoryTotalGB -Sum).Sum
"Clustername" =$cluster.Name
"Num of CPUs" =($esx | Measure-Object -Property NumCpu -Sum).Sum
"Total CPU (Mhz)" =($esx | Measure-Object -Property CpuTotalMhz -Sum).Sum
"Configured CPU (Mhz)" =($esx | Measure-Object -Property CpuUsageMhz -Sum).Sum
"Datacenter" =(Get-Datacenter -Cluster $cluster).Name
"Number of VMs" =($esx | Get-VM).count
"Number of ESXi Hosts" =$esx.count
}
Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))
}
Thanks
N
Hi @Anonymous
Is that a PowerShell script? Sorry I'm not familiar with it. But if your script is doubling the values in your data, is it reading the current values and then adding them back to itself?
Phil
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
8 | |
6 | |
6 | |
6 |