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
hmokkapati
Helper II
Helper II

Delay Queries

Hello,

 

I have a pbix where I have around 7 queries. Is there a way I can stop queries 2 to 7 to start processing unless i finish Query 1. I can use the Function.InvokeAfter(), but there is no way to know how long the first query would take.

 

More back ground: The need is to get data from Anaplan. Before getting the latest data, the export file in Anaplan has to be refreshed. So, Query1 would be refreshing these files through an API. After this refresh is done, latest data has to be pulled in other queries using other APIs. So the need is to wait until Query1 is finished and then run the other queries when we do "Refresh All".

 

Any pointers appreciated.

 

Thank You,

Harisha

1 ACCEPTED SOLUTION
ImkeF
Super User
Super User

To my knowledge it is not possible to let one query start after another one has finished. As it is not possible to influence the order of queries. So the options you have are:

 

1) make the Function.InvokeAfter-time long enough plus some buffer

2) allocate your queries into 2 different folders and manually start the refresh of the 1st one and then start the refresh of the other ones manually again

3) Always refresh twice (this would only work if the data doesn't change in between)

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

4 REPLIES 4
ImkeF
Super User
Super User

To my knowledge it is not possible to let one query start after another one has finished. As it is not possible to influence the order of queries. So the options you have are:

 

1) make the Function.InvokeAfter-time long enough plus some buffer

2) allocate your queries into 2 different folders and manually start the refresh of the 1st one and then start the refresh of the other ones manually again

3) Always refresh twice (this would only work if the data doesn't change in between)

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Hello Imke,

 

 

 

As a second thought, even if we have queries in different folders and decide to refresh each folder separately how can I achieve the same once the file is published to the Online Service? Any pointers?

 

Thank You,

Harisha

Sorry, no - this is not my field.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Hello Imke,

 

I think i will go with the first option for now with enough buffer.

 

Thanks for your response. Appreciate your time.

 

Thank You,

Harisha

 

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.