Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hola a todos, me gustaria poder tener graficas en tiempo real en power bi, he tratado de hacer una pequena prueba con power shell, pero no me ha funcionado, alguien podria ayudarme?
En power shell uso el siguiente codigo
$dataSource = ' ' #Server Name$userName = ' ' #SQL User Name$password = ' ' #SQL User Password$database = ' ' #Database Name #Uncomment below connection string to use windows credentials#$connectionString = "Data Source=$dataSource;Initial Catalog=$database;Integrated Security=SSPI" #Uncomment below connection string to use SQL Server authentication $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 = ' select tipo,fecha from vt_archivos;' $command = $connection.CreateCommand()$command.CommandText = $query $dataset = $command.ExecuteReader() #paste the endpoint URL which you have inside Power BI$endpoint = "Miurl" #push data to Power BI while ($dataset.Read()) { $payload = @{ "tipo" =$dataset['tipo'] "fecha" =$dataset['fecha'] } Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))} $connection.Close();$connection.Dispose();
Pero al usarlo no me hace bien la consulta y despues de intentar crear una grafica, arroja este error
Invoke-RestMethod : {"error":{"message":"The request was blocked by KeyBlocker "}}En línea: 35 Carácter: 5+ Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo- ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc eption + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Solved! Go to Solution.
Hi, @Jose_Sierra
Based on your desription, there is something wrong with your way to use realtime streaming. It is suggested to refer to the following link, which contains example of using realtime streaming in Power BI.
https://docs.microsoft.com/en-us/power-bi/service-real-time-streaming
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Jose_Sierra
Based on your desription, there is something wrong with your way to use realtime streaming. It is suggested to refer to the following link, which contains example of using realtime streaming in Power BI.
https://docs.microsoft.com/en-us/power-bi/service-real-time-streaming
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.