Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago

Dynamic Data Source Error in Power Query

I'm getting Dynamic Data Source error in Power Query as below :
"Some data sources may not be listed because of hand-authored query"

 

and below is my code; How should I modify it?

let
BaseUrl = "https://yourdomain.udemy.com/api-2.0/organizations/224484/analytics/user-course-activity/",
EntitiesPerPage = 100,

GetJson = (Url) =>
let Options = [Headers=[ #"Authorization" = "Token"]],
RawData = Web.Contents(Url, Options),
Json = Json.Document(RawData)
in Json,

GetEntityCount = () =>
let Url = BaseUrl,
Json = GetJson(Url),
Count = Json[#"count"]
in Count,

GetPage = (Index) =>
let Page = "?&page=" & Text.From(Index),
Page_Size = "&page_size=100",
Url = BaseUrl & Page & Page_Size,
Json = GetJson(Url),
Value = Json[#"results"]
in Value,

EntityCount = List.Max({ EntitiesPerPage, GetEntityCount() }),
PageCount = Number.RoundUp(EntityCount / EntitiesPerPage),
PageIndices = {1 .. PageCount},
Pages = List.Transform(PageIndices, each GetPage(_)),
Entities = List.Union(Pages),
Table = Table.FromList(Entities, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

6 Replies

  • That's not an error, only a note.  Do you have an actual issue with the query?

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Dear  Syndicate,
      Thanks for your response.

      Actually, error happens when we want to refresh the dashboard on Power BI Service, as below. 
      I've also attached error screenshot. 

      Error Message:
      "This dataset includes a dynamic data source. Since dynamic data sources aren't refreshed in the Power BI service, this dataset won't be refreshed. " 

      • lbendlin's avatar
        lbendlin
        Super User

        Please read the documentation of Web.Contents - you need to use the Query parameter.

  • Dear  Syndicate,
    Thanks for your response.

    Actually, error happens when we want to refresh the dashboard on Power BI Service, as below. 
    I've also attached error screenshot. 

    Error Message:
    "This dataset includes a dynamic data source. Since dynamic data sources aren't refreshed in the Power BI service, this dataset won't be refreshed. "