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 dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
When ai try run this script, it return error message.
$SqlServer = 'GRANITOAON';
$SqlDatabase = 'DWPago';
$SqlConnectionString = 'Data Source={0};Initial Catalog={1};Integrated Security=SSPI' -f $SqlServer, $SqlDatabase;
$SqlQuery = "select a.QuantidadeTransações as TransacoesMes, a.ValorTransacionado as ValorTransacoesMes, b.QuantidadeTransações as TransacoesDia, b.ValorTransacionado as ValorTransacoesDia, c.Data as Data, c.TransacoesUltimoMin as TransacoesMinuto, c.TempoProcessamentoBD as TempoProcessamentoBD, c.TempoProcessamentoSocket as TempoProcessamentoSocket, c.TempoProcessamentoHSM as TempoProcessamentoHSM from [vw_rt_transacoesmes] a, [vw_rt_transacoesdia] b, [vw_rt_processamentotransacao] c;";
$SqlCommand = New-Object -TypeName System.Data.SqlClient.SqlCommand;
$SqlCommand.CommandText = $SqlQuery;
$SqlConnection = New-Object -TypeName System.Data.SqlClient.SqlConnection -ArgumentList $SqlConnectionString;
$SqlCommand.Connection = $SqlConnection;
$SqlConnection.Open();
$SqlDataReader = $SqlCommand.ExecuteReader();
##you would find your own endpoint in the Power BI service
$endpoint = "https://api.powerbi.com/beta/0c4e7c53-5100-4c56-8aa0-9705f186a05c/datasets/75393a01-8326-41ab-a4aa-c..."
#Fetch data and write out to files
while ($SqlDataReader.Read()) {
$payload = @{
"Transações Mês" =$SqlDataReader['TransacoesMes']
"Valor Transacionado Mês" =$SqlDataReader['ValorTransacoesMes']
"Transações Dia" =$SqlDataReader['TransacoesDia']
"Valor Transacionado Dia" =$SqlDataReader['ValorTransacoesDia']
"Data" =$SqlDataReader['Data']
"Transações por minuto" =$SqlDataReader['TransacoesMinuto']
"Tempo Médio Procesamento BD" =$SqlDataReader['TempoProcessamentoBD']
"Tempo Médio Processamento Socket" =$SqlDataReader['TempoProcessamentoSocket']
"Tempo Médio Processamento HSM" =$SqlDataReader['TempoProcessamentoHSM']
}
Invoke-RestMethod -Method Post -Uri $endpoint -Body (ConvertTo-Json @($payload))
}
$SqlConnection.Close();
$SqlConnection.Dispose();
Error
Invoke-RestMethod : The remote server returned an error: (404) Not Found.
At line:33 char:5
+ Invoke-RestMethod -Method Post -Uri $endpoint -Body (ConvertTo-Json @($paylo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
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 |
---|---|
8 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |