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),
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
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?
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. "
.
mmbr1606
9
Super User 2025 Season 1
stampcoin
7
SD-13050734-0
6