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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply

Buffer web query request

Hello there,

 

I have function which i am using to get statistics from POST method: fnMotorModes_Get

let
    Source = (AuthorizationId as text, StatisticsId as text) => 
    let
        data = Json.FromValue([StatisticsSessionId=StatisticsId]),
        headers = [#"accept"="*/*", #"ScoutAuthorization"=AuthorizationId, #"Content-Type"="application/json"],
        web = Web.Contents("url", [ Content = data, Headers = headers, Timeout=#duration(0,0,0,10), ManualStatusHandling = {404, 400}]),
        source = ()=> Json.Document(web),
        result = Function.InvokeAfter(source, #duration(0,0,0,5))
in
    Source

 

This function i invoke like Custom Function only one time in MotorModes table:

Bessonnizza1992_0-1600269693919.png

Tables MotorModesTotal and MotorModesEvents are created via Reference button from MotorModes table. When i update data i check Fiddler Web Debugger and see that PowerQuery address to web service three times. One time for every table.

 

What do i need to add in query to make only one request to web service?

1 ACCEPTED SOLUTION
edhans
Super User
Super User

I am not sure you can. It doesn't work top down, it works bottom up. So if you have 3 final tables in your model from a source, it starts at those 3 tables in Power Query then works backwards to the source, so you will get three refreshes. You can optimize it perhaps by turning off background data in settings.

 

There is a good video from Guys in a Cube with Chris Webb that will help explain this as well.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

3 REPLIES 3
edhans
Super User
Super User

I am not sure you can. It doesn't work top down, it works bottom up. So if you have 3 final tables in your model from a source, it starts at those 3 tables in Power Query then works backwards to the source, so you will get three refreshes. You can optimize it perhaps by turning off background data in settings.

 

There is a good video from Guys in a Cube with Chris Webb that will help explain this as well.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

@edhans 
What about Tabble.Buffer?


Mb this function can help me.

No. As the docs indicate, it is for a specific purpose. "Buffers a table in memory, isolating it from external changes during evaluation."

 

A popular use of it is when sorting data. Additional data/transformations can cause sort order to change. Table.Buffer() isolates it from that. I also use it to purposfully break query folding in some instances. But it is not taking the table as is, and putting the whole thing in memory for all downstream transformations to use. 

 

If you go through the article to see how the queries are hitting that source data, you can wrap Table.Buffer() around whatever step you want, but it will still query the source table 3 times if you have 3 references to it.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors