Showing results for 
Search instead for 
Did you mean: 
sudhak Frequent Visitor
Frequent Visitor

Data refresh error



I am taking data from M language query from Azure Application insights. But while refreshing the data, we are getting error (500: internal server error).

Refresh failed.PNG


Below is the error i am getting from power bi. But now able to understand the issue. 


DataSource.Error: Web.Contents failed to get contents from '' (500): Internal Server Error

Below is the source code i am using: 

let AnalyticsQuery =
let Source = Json.Document(Web.Contents("", 
| where timestamp >= datetime(2018-02-07T14:59:59.999Z) and timestamp < datetime(2018-02-14T15:00:00.001Z)
| where (itemType == 'pageView' and (timestamp >= datetime(2018-02-07T15:00:00.000Z) and timestamp <= datetime(2018-02-14T15:00:00.000Z)))
| top 1000 by timestamp desc
TypeMap = #table(
{ "AnalyticsTypes", "Type" }, 
{ "string",   Text.Type },
{ "int",      Int32.Type },
{ "long",     Int64.Type },
{ "real",     Double.Type },
{ "timespan", Duration.Type },
{ "datetime", DateTimeZone.Type },
{ "bool",     Logical.Type },
{ "guid",     Text.Type },
{ "dynamic",  Text.Type }
DataTable = Source[tables]{0},
Columns = Table.FromRecords(DataTable[columns]),
ColumnsWithType = Table.Join(Columns, {"type"}, TypeMap , {"AnalyticsTypes"}),
Rows = Table.FromRows(DataTable[rows], Columns[name]), 
Table = Table.TransformColumnTypes(Rows, Table.ToList(ColumnsWithType, (c) => { c{0}, c{3}}))


Can anyone please help what is wrong here? How we can get the data refreshed?

Any help with this is really appreciated!



Super User III
Super User III

Re: Data refresh error

@sudhak Are you using a gateway? I don't recall when the change was implemented, but it was awhile ago that you need a gateway when using web.contents i believe.

Looking for more Power BI tips, tricks & tools? Check out the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG
bcharlto Frequent Visitor
Frequent Visitor

Re: Data refresh error

Did you figure it out? I am getting the same error...

Helpful resources

Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors