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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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