Forum Discussion
Incremental Refresh with API
- Anonymous1 year ago
Hi PedroModa,
Power BI won’t let your report refresh online if your Web.Contents uses a URL that’s built using text joined together while the report is running. That’s because Power BI doesn’t know in advance what websites or addresses it might try to access.
To fix this, you should separate the main part of the URL (the base) from the parts that change (like dates or filters). You can do that by using the Query and RelativePath options in Web.Contents, like below.
(DataInicio as text, DataFim as text) => let Fonte = Json.Document( Web.Contents( "https://api.example.com", // Static base URL [ RelativePath = "endpoint", // Static relative path Query = [ DATAINICIO_D = DataInicio, DATAFINAL_D = DataFim], Headers = [ #"Authorization" = "Bearer YOUR_TOKEN" // Or whatever is required ]])) in Fonte
Hi PedroModa,
Power BI won’t let your report refresh online if your Web.Contents uses a URL that’s built using text joined together while the report is running. That’s because Power BI doesn’t know in advance what websites or addresses it might try to access.
To fix this, you should separate the main part of the URL (the base) from the parts that change (like dates or filters). You can do that by using the Query and RelativePath options in Web.Contents, like below.
(DataInicio as text, DataFim as text) =>
let
Fonte = Json.Document(
Web.Contents(
"https://api.example.com", // Static base URL
[
RelativePath = "endpoint", // Static relative path
Query = [
DATAINICIO_D = DataInicio,
DATAFINAL_D = DataFim],
Headers = [
#"Authorization" = "Bearer YOUR_TOKEN" // Or whatever is required
]]))
in
Fonte