Forum Discussion
Power BI Online - Cannot Set up Automatic Refresh for REST API Source Without Gateway
- 1 year ago
Hi komyji
Thanks for sharing this it's a common issue when using REST APIs in Power BI Service, even when the API is public and works perfectly in Power BI Desktop.
Now, why this happens and how you can resolve it without needing an on-premises data gateway.
Power BI Service performs a security check to detect dynamic data sources — and this includes any queries that build URLs dynamically, such as
Pagination via List.Generate
Using Web.Contents() with RelativePath inside a function
Dynamically constructed query strings or endpoints
Once a query is flagged as dynamic, Power BI disables direct cloud refresh and requires a gateway, even for public endpoints. This behavior is confirmed by Microsoft and discussed in multiple community threads.
How to Fix It (No Gateway Required)
Use Web.Contents with a static base URL, and pass pagination and filters through RelativePath and Query parameters. This makes your query predictable and certifiable, reducing the chance of being flagged as dynamic.Example
Web.Contents(
"https://gis.brno.cz",
[
RelativePath = "ags1/rest/services/Hosted/cyklo_meteo_merged/FeatureServer/0/query",
Query = [
where = "1=1",
resultOffset = "0",
resultRecordCount = "1000",
f = "json"
]
]
)This approach is recommended in various threads mentioned below. Follow this and let me know if it works for you — and feel free to support this post as a solution
https://stackoverflow.com/questions/77061776/this-dataset-includes-a-dynamic-data-source-since-dynamic-data-sources-aren-t
https://community.fabric.microsoft.com/t5/Desktop/Help-applying-Query-and-Relative-path-to-avoid-dynamic-data/td-p/1573538
Hi komyji ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh
Hi @komyji ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh