Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
yforti
Helper II
Helper II

Refresh dynamic date

Hey guys!

I'm working on a data model that consumes an api, where I need to do the pagination of this api.

I did the pagination the way below and everything worked fine, however, when I publish it to my workspace I can't update it.


I receive the following error:
"This dataset includes a dynamic data source. Because dynamic data sources are not updated in the Power BI service, this dataset will not be updated. Learn more: https://aka.ms/dynamic-data-sources."

let
    Consulta1 = let
_GetAPIPageData = (offset as number) =>
let
    Fonte = Json.Document(Web.Contents("urlofapi?Take=1000&Page..."&Number.ToText (offset))),
    #"Convertido para Tabela" = Table.FromRecords({Fonte}),
    #"data Expandido" = Table.ExpandRecordColumn(#"Convertido para Tabela", "data", {"hasValue", "value"}, {"data.hasValue", "data.value"}),
    #"data.value Expandido" = Table.ExpandRecordColumn(#"data Expandido", "data.value", {"quantidadeTotalRegistros", "quantidadeTotalPaginas", "relatorioDebitoModel"}, {"data.value.quantidadeTotalRegistros", "data.value.quantidadeTotalPaginas", "data.value.relatorioDebitoModel"}),
    #"Tipo Alterado" = Table.TransformColumnTypes(#"data.value Expandido",{{"data.hasValue", type logical}, {"data.value.quantidadeTotalRegistros", Int64.Type}, {"data.value.quantidadeTotalPaginas", Int64.Type}, {"data.value.relatorioDebitoModel", type any}, {"messages", type any}, {"hasError", type logical}}),
    #"data.value.relatorioDebitoModel Expandido" = Table.ExpandListColumn(#"Tipo Alterado", "data.value.relatorioDebitoModel"),
    #"data.value.relatorioDebitoModel Expandido1" = Table.ExpandRecordColumn(#"data.value.relatorioDebitoModel Expandido", "data.value.relatorioDebitoModel", {"id", "adquirente", "transacao", "bandeira", "servico", "maquineta", "modalidade", "banco", "dataVenda", "dataCreditoRepasse", "dataBaixa", "valorBruto", "valorTarifa", "nsu", "autorizacao", "resumoDeVendas", "numCartao", "nsa"}, {"data.value.relatorioDebitoModel.id", "data.value.relatorioDebitoModel.adquirente", "data.value.relatorioDebitoModel.transacao", "data.value.relatorioDebitoModel.bandeira", "data.value.relatorioDebitoModel.servico", "data.value.relatorioDebitoModel.maquineta", "data.value.relatorioDebitoModel.modalidade", "data.value.relatorioDebitoModel.banco", "data.value.relatorioDebitoModel.dataVenda", "data.value.relatorioDebitoModel.dataCreditoRepasse", "data.value.relatorioDebitoModel.dataBaixa", "data.value.relatorioDebitoModel.valorBruto", "data.value.relatorioDebitoModel.valorTarifa", "data.value.relatorioDebitoModel.nsu", "data.value.relatorioDebitoModel.autorizacao", "data.value.relatorioDebitoModel.resumoDeVendas", "data.value.relatorioDebitoModel.numCartao", "data.value.relatorioDebitoModel.nsa"})
in
    #"data.value.relatorioDebitoModel Expandido1"
 
in
let
allRows = Json.Document(Web.Contents("urlofapi")),
apiCallResults = List.Generate(() => [Offset = 1, apiPageResult = _GetAPIPageData(0)],
                    each [Offset] <= allRows[data][value][quantidadeTotalPaginas] + 1,
                    each [apiPageResult = _GetAPIPageData( [Offset]), Offset = [Offset] + 1 ],
                    each [apiPageResult])
 
in
Table.Combine(apiCallResults)
in
    Consulta1

Can anyone help?
1 REPLY 1
lbendlin
Super User
Super User

please refer to the documentation. Use RelativePath and Query options.

Web.Contents - PowerQuery M | Microsoft Learn

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.