cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Super User III
Super User III

Re: Delay Queries

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
Super User III
Super User III

Re: Delay Queries

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

hmokkapati Helper II
Helper II

Re: Delay 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

 

hmokkapati Helper II
Helper II

Re: Delay 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

Super User III
Super User III

Re: Delay Queries

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

Helpful resources

Announcements
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors