web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dynamic Data Source Er...
Power Apps
Unanswered

Dynamic Data Source Error in Power Query

(0) ShareShare
ReportReport
Posted on by 6

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),

Categories:
I have the same question (0)
  • MayGolGTB Profile Picture
    6 on at

    .

  • MayGolGTB Profile Picture
    6 on at

    Dear  Syndicate,
    Thanks for your response.

    Actually, error happens when we want to refresh the dashboard on Power BI Service, as below. 

    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. " 

    Dynamic Data Source Error.png

    Dynamic Data Source Error.png
  • MayGolGTB Profile Picture
    6 on at

    Yeah, I know  but unfortunately I don't know how exactly I should do that. Can you modify the M code that I've mentioned above?

  • gscruzz Profile Picture
    2 on at

    Hi friend, how are you? I saw that your suggestion helped a colleague who needed help. I have a similar case and I've tried several alternatives, experimenting with different variations of the "Web.Contents", "Query", "Expression.Evaluate", "Text.FromBinary" functions, but I've had no success. I've looked for solutions in various videos, blogs (including Chris Webb's blog which covers some similar cases)... The code below is still considered to be a dynamic data source, which has greatly hindered the automatic updating of some reports. Can you help me identify the problem?

     

    // EPNTV001 - VCAD_Project Base2

    let
    // Defina as credenciais
    User = "marcella.piceli@promon.com.br",
    Password = "Hg6qNqeAquH2S2TZjn8J",

    // Função para obter o token
    GetToken = () =>
    let
    token_url = "https://flounder-amusing-moderately.ngrok-free.app/get_token",
    token_response = Json.Document(
    Web.Contents(
    token_url,
    [
    Content=Text.ToBinary("user=" & User & "&password=" & Password),
    Headers=[#"Content-Type"="application/x-www-form-urlencoded"]
    ]
    )
    ),
    token = token_response[token]
    in
    token,

    // Obtenha o token
    token = GetToken(),

    // Continue com a lógica de obtenção de arquivos
    fn = "/get_file_content/",
    root = "https://flounder-amusing-moderately.ngrok-free.app",
    root_url = "https://flounder-amusing-moderately.ngrok-free.app/get_files",
    root_source = Json.Document(
    Web.Contents(
    root_url,
    [Query=[#"token"=token]]
    )
    ),
    filesTable = Table.FromList(root_source, Splitter.SplitByNothing()),
    #"Column Expanded" = Table.ExpandRecordColumn(filesTable, "Column1", {"id", "name"}, {"fileId", "Nome do Arquivo"}),

    // Filtrar a tabela para encontrar o fileId desejado
    file = Table.SelectRows(#"Column Expanded", each Text.Contains([Nome do Arquivo], "EPTNV001 - VCAD_Project Base2")),

    // Utilizar Expression.Evaluate com token na URL
    file_source = Expression.Evaluate(
    Text.FromBinary(
    Web.Contents(
    root & fn & file{0}[fileId] & "?token=" & token
    )
    ),
    #shared
    )
    in
    file_source

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 638

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard