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
ermak
Frequent Visitor

Loop the query and pause between requests

Hello. Ask for help.

I'm taking data from the API through a function. If the data is not ready, the API gives the message "Your report is not ready yet, try to update it later". Then I need to wait 10-20 seconds and update the request. Sometimes I need to update 2-3-5 times, depending on the amount of data.

Is it possible to loop the query until it returns data instead of the phrase "Your report is not ready yet..."? And can I set a pause between requests?

 

let
    Source = PQYD(Date_and_API{0}[APID], null, "Date,Impressions,Clicks,Ctr,Cost,AvgCpc,AvgClickPosition,CampaignName,AdGroupName,Criteria,AdNetworkType,LocationOfPresenceName", "CRITERIA_PERFORMANCE_REPORT", Date_and_API{0}[30 days ago], Date_and_API{0}[Yesterday])
in
    #"Source"

image.png

 

After a few updates

image.png

 

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@ermak ,

 

Power query supports loop/iteration but doesn't support function like pause/sleep, about the workaround, I would suggest you to refer to similar thread:

https://community.powerbi.com/t5/Desktop/Query-to-Scrap-URLs-with-a-pause-every-xx-URLs/td-p/352809

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@ermak ,

 

Power query supports loop/iteration but doesn't support function like pause/sleep, about the workaround, I would suggest you to refer to similar thread:

https://community.powerbi.com/t5/Desktop/Query-to-Scrap-URLs-with-a-pause-every-xx-URLs/td-p/352809

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.