Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hmokkapati
Helper II
Helper II

Multiple API calls going to the Service

Hello,

 

I have Power BI Query which has M Code to make a single API call. But when the query is monitored in Fiddler I see there are 2 API calls made.

I saw a similar thing in Power Query and Power Pivot too. Is it done once for ETL and once for loading into the data model? How can I limit it to make only one call as the API to which the call is made not only gets but posts data on the server.

 

Any pointers appreciated.

 

Thank You,

Harisha

4 REPLIES 4
v-micsh-msft
Employee
Employee

Hi hmokkapati,

Which API call that you have in the M code, would it be available to share some information about the API, and the Fiddler trace here?

I suspect this should be more specific with the API side. Some API would need verification first before getting the data.

In addition, I will perform some tests and see if I could find any helpful inforamtion.

Regards

Hello Michael,

 

Thanks for your reply.

 

Unfortuantely cannot share the API details. Its internal.

 

But what I observed is when I choose to "Load it to data model" thats when it makes 2 calls, otherwise when its loaded to sheet/connection without loading to data model its called only once.

 

Thank You,

Harisha

Hi hmokkapati, 

If the second call is made after clicking "load" or "edit" in the Get Data Wizard, then I don't think currently there is a way available to avoid it.

We may consider to make the API query into a function, so the next time when a new query needed, we could just enter the Parameter instead of re-writing the Query again.

Check the blog below and see if this would be helpful:

Querying the VSTS Work Items API directly from Power BI

Regards

 

Hello Michael,

 

Below is the code to call the API and it makes so many calls whether its a success or failure....I can see there are multiple calls in Fiddler. Is there a setting in PowerBI that could stop from making so many calls in both scenarios. Attached are the calls in Fiddler in both cases. This affects the stability of the entire system..as the API call also Posts some data. These are calls from multiple queries when i do a "Refresh All". Please help.

 

 

let

//Get the dataset from Azure API that calls the Anaplan API
fileName ="LRP-PowerBI",
Datachunks=Csv.Document(Web.Contents(ExportURL & fileName)),
#"Promoted Headers" = Table.PromoteHeaders(Datachunks)

in

#"Promoted Headers"

 

 

fiddler response for failure in Power BI.PNGfiddler response for success.PNG



Thank You,

Harisha

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.