cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Real-time-streaming on Powerbi

Hi 

we can't get til Real time streaming to work. Ther is no data comming in. All  the data is coming from powershell.  But if i take a report i can see the data comming in.

 

The powershell is looking like this.:

[
{
"happylevel" :98.6
}
]

 

 

https://docs.microsoft.com/en-us/power-bi/connect-data/service-real-time-streaming

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Real-time-streaming on Powerbi

@brt ,

 

You need to create a custom streaming dataset tile firstly and add your streaming dataset tile to the tile. Copy the endpoint url, the sample powershell code should be like pattern below:

$dataSource = 'Server Name' 
$userName = 'Windows Name' 
$password = 'Windows Password' 
$database = 'Database Name' 
$connectionString ="Server=$dataSource;Database=$database;trusted_connection=false; user id =$userName;Password=$password;Integrated Security=False"
$connection = New-Object System.Data.SqlClient.SqlConnection
$connection.ConnectionString = $connectionString
$connection.Open()
$query = 'SQL Query'
$command = $connection.CreateCommand()
$command.CommandText = $query
$dataset = $command.ExecuteReader()

$endpoint = "endpoint URL"
#push data to Power BI 
while ($dataset.Read()) {
    $payload = @{
    }
    Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))
}
$connection.Close();
$connection.Dispose();

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Real-time-streaming on Powerbi

@brt ,

 

You need to create a custom streaming dataset tile firstly and add your streaming dataset tile to the tile. Copy the endpoint url, the sample powershell code should be like pattern below:

$dataSource = 'Server Name' 
$userName = 'Windows Name' 
$password = 'Windows Password' 
$database = 'Database Name' 
$connectionString ="Server=$dataSource;Database=$database;trusted_connection=false; user id =$userName;Password=$password;Integrated Security=False"
$connection = New-Object System.Data.SqlClient.SqlConnection
$connection.ConnectionString = $connectionString
$connection.Open()
$query = 'SQL Query'
$command = $connection.CreateCommand()
$command.CommandText = $query
$dataset = $command.ExecuteReader()

$endpoint = "endpoint URL"
#push data to Power BI 
while ($dataset.Read()) {
    $payload = @{
    }
    Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))
}
$connection.Close();
$connection.Dispose();

 

Regards,

Jimmy Tao

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Top Solution Authors
Top Kudoed Authors