Forum Discussion
Unexpected Multiple Requests from Power BI Connector
- 1 year ago
Hey v-kpoloju-msft,
priorities shift at work this week, so I didn't have time yet to look into your suggestions. Hope I will find some time next week to look into Diagnostics.Cache.
Api.Folder doesn't look poosible at this point, but maybe later.
Disabling the preview didn't change anything for me regarding the number of requests. But since I already reduced requests at that point (and I don't have controll over everyone who uses the connector to turn that option off) I don't think that's helping.
Sorry again for the delay and thanks again for all the help and input!
Regards,
Scheißy
Hi Scheißy,
Thank you for reaching out to the Microsoft fabric community forum. Also, thanks to Nasif_Azam, for those inputs on this thread and for the detailed description you are absolutely on the right track, and great job using diagnostics for deeper insight.
The issue you are experiencing, where the API endpoints (especially authentication and file download) are hit multiple times, is a known behaviour in custom Power BI connectors. It often happens because Power BI evaluates the connector logic multiple times for example, during schema discovery, preview, and data load phases.
To reduce redundant calls, especially for authorization and file download, you can implement caching using Function.Cached in your Power Query M code. This ensures that your token and file data are computed once and reused across calls.
Cache the authentication token using Function.Cached. Wrap your file download function (loadCsvFile) in another Function.Cached to prevent redundant fetches. Consider using ResourcePath in Web.Contents to improve connector performance.
Kindly refer to the below mentioned links for more information:
Web.Contents - Power Query M | Microsoft Learn
Power Query M function reference - Power Query M | Microsoft Learn
Connector extensibility in Power BI - Power BI | Microsoft Learn
Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.
Thank you for using the Microsoft Fabric Community Forum.
Hey v-kpoloju-msft,
thanks for your input. I'll try that stuff and check your links, but I already have a question:
You mention the "ResourcePath" option. I tried that, but I always got an error message that the ResourcePath option isn't a valid Web.Contents option. Google said that this error message should only happen in Visual Studio, but I keep hitting that same error message in Power BI. What am I doing wrong?