I have 7 web api data sources in my pbix file. I am able to refresh in PBI Desktop (takes about 20 mins) but not in PBI web service. I have added some code that prior to adding them, I was also not able to refresh in PBI Desktop. It was timing out. I'm trying to understand why I'm able to refresh in the PBI desktop but not on the web. What am I missing? Below is the M code I'm using in one of the queries. They are all pretty much the same structure. Just different parameters. To summarize, the added Timeout and sessionTimeout codes made the refresh work for PBI desktop but not PBI web service.