Forum Discussion
Live Stream Power BI
- 3 years ago
Yes, it was an example. Run your SQL query, convert the result to JSON, then use that as the payload.
You can certainly do that - run a query against the SQL table and push the result into the streaming dataset. It sounds a little weird though - how real time is your SQL data source?
- AliSafa3 years agoAdvocate I
its each 15 minutes. you said run a query against the SQL table and push the result into the streaming dataset.
the question is how to push the rsult to streaming Dataset?
thx
- lbendlin3 years agoSuper User
Real-time streaming in Power BI - Power BI | Microsoft Learn
Here is an example using Powershell
#capture stats $date = (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:00.000Z') $mem = (Get-Counter '\Memory\Available MBytes').CounterSamples.CookedValue $proc = (Get-Counter '\Processor(_Total)\% Processor Time').CounterSamples.CookedValue $disk = (Get-Counter '\LogicalDisk(C:)\% free space').CounterSamples.CookedValue $mashups = 0+(get-process "Microsoft.Mashup.Container.NetFX45" | Measure-Object ).Count $mashmem = 0+(get-process "Microsoft.Mashup.Container.NetFX45" | Measure-Object WS -Sum ).Sum $gwmem = 0+(get-process "Microsoft.PowerBI.EnterpriseGateway" | Measure-Object WS -Sum ).Sum #enforce TLS1.2 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $payload = @{ "Host" = $env:computername "Timestamp" = $date "Available Memory in MB" = $mem "Processor Load %" = $proc "% Free on C:" = $disk "Mashups" = $mashups "Mashup Memory" = $mashmem "Gateway Memory" = $gwmem } #push URL $endpoint = "https://api.powerbi.com/beta/<tenant ID>/datasets/<dataset id>/rows?key=<API key>" Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))- AliSafa3 years agoAdvocate I
thank you for your answer
it seems that this code is reading data from memory and Processor etc and push it into the streamin dataset.
but i need to read data from a sql table and push it to a Streaming dataset.