cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Jose_Sierra
Frequent Visitor

Ayuda con datos en tiempo real

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

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-alq-msft
Microsoft

Re: Ayuda con datos en tiempo real

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.

 

View solution in original post

1 REPLY 1
Microsoft v-alq-msft
Microsoft

Re: Ayuda con datos en tiempo real

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.

 

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors