Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Query
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),

  • gscruzz Profile Picture
    2 on at
    Re: Dynamic Data Source Error in Power Query

    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

  • MayGolGTB Profile Picture
    6 on at
    Re: Dynamic Data Source Error in Power Query

    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?

  • MayGolGTB Profile Picture
    6 on at
    Re: Dynamic Data Source Error in Power Query

    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

  • MayGolGTB Profile Picture
    6 on at
    Re: Dynamic Data Source Error in Power Query

    .

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Query

#1
mmbr1606 Profile Picture

mmbr1606 9 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 7

#3
SD-13050734-0 Profile Picture

SD-13050734-0 6

Overall leaderboard

Featured topics