Forum Discussion

SabaAbuarar9's avatar
SabaAbuarar9
Regular Visitor
2 months ago
Solved

Power BI keeps loading when connecting to a REST API

Hello,

I am experiencing an issue while connecting Power BI Desktop to a REST API.

The API works successfully in Postman; however, it takes approximately 2 minutes to return the response. When I use the same API in Power BI, the request keeps loading indefinitely, and after some time the process appears to restart instead of completing the import.

The API returns approximately 5 MB of XML data.

I have verified the following:

The API endpoint is correct.

Authentication is successful.

The API returns the expected data in Postman.

The issue only occurs when the API is consumed by Power BI.

Has anyone encountered a similar issue? Is there a timeout limit or a recommended approach for consuming slow REST APIs in Power BI?

Any guidance would be greatly appreciated.

Thank you.

  • v-sathmakuri's avatar
    v-sathmakuri
    2 months ago

    Hi SabaAbuarar9  , 

     

    Glad to hear it worked.

     

    If the data loaded almost instantly and your API didn't receive a new request, Power BI may have returned a cached response instead of calling the API again. Power Query caches requests during development to improve performance. To verify try refreshing the preview, clearing the Power BI cache, or making a small change to the request (such as adding a dummy query parameter) and see if the API is called again.

     

    Cache clearing in power bi desktop : Troubleshoot Power BI Desktop publishing - Power BI | Microsoft Learn 

     

    If it still doesn't reach your API, please let us know whether you are refreshing the Power Query preview or performing a full dataset refresh as the behavior can differ.

     

    Thanks!!

5 Replies

  • v-sathmakuri's avatar
    v-sathmakuri
    Icon for Community Support rankCommunity Support

    Hi SabaAbuarar9 ,

     

    Thank you for reaching out to fabric community.

     

    • Since your API takes around 2 minutes to respond, it may be hitting Power Query's default Web.Contents timeout (about 100 seconds). If you're using Web.Contents, try increasing the timeout using the Timeout option as below

    Web.Contents(
    "https://your-api-url",
    [Timeout = #duration(0, 0, 5, 0)]
    )

    • If the API supports pagination or filtering, try reducing the amount of data it returns
    • Check Power Query Diagnostics (Tools → Start Diagnostics) to determine whether the request is timing out, being retried, or failing for another reason.

    Thanks!!

    • SabaAbuarar9's avatar
      SabaAbuarar9
      Regular Visitor

      Thank you for answering my question.

      This approach worked. However, I noticed something unusual: it didn't appear to send the request to the API I created, yet the data loaded almost instantly. This is strange because the same API takes around two minutes to respond in Postman.

      Could you please explain why this might be happening?

      • v-sathmakuri's avatar
        v-sathmakuri
        Icon for Community Support rankCommunity Support

        Hi SabaAbuarar9  , 

         

        Glad to hear it worked.

         

        If the data loaded almost instantly and your API didn't receive a new request, Power BI may have returned a cached response instead of calling the API again. Power Query caches requests during development to improve performance. To verify try refreshing the preview, clearing the Power BI cache, or making a small change to the request (such as adding a dummy query parameter) and see if the API is called again.

         

        Cache clearing in power bi desktop : Troubleshoot Power BI Desktop publishing - Power BI | Microsoft Learn 

         

        If it still doesn't reach your API, please let us know whether you are refreshing the Power Query preview or performing a full dataset refresh as the behavior can differ.

         

        Thanks!!

  • v-sathmakuri's avatar
    v-sathmakuri
    Icon for Community Support rankCommunity Support

    Hi SabaAbuarar9 ,

     

    Could you please review the suggestion provided above and let us know if you still have any further questions?

     

    Thanks!!