Forum Discussion

komyji's avatar
komyji
Frequent Visitor
1 year ago
Solved

Power BI Online - Cannot Set up Automatic Refresh for REST API Source Without Gateway

Hello, I have a Power BI report where I connected to data from ArcGIS Online using a public REST API endpoint. Because the REST API only returns 1,000 records per request, I wrote an M query (Power ...
  • shashiPaul1570_'s avatar
    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