Reply
Advisor
Posts: 363
Registered: ‎06-26-2015
Accepted Solution

Conditional Refresh

[ Edited ]
Does anyone have an example of an M script where a parameter was employed so that a query refreshes in Desktop and doesn't refresh in Service (or vice versa)? I was thinking something along the lines of checking the parameter value, and if true, proceed through a set of scripted steps. If false, effectively go to the end of the script without executing any steps.
 
Any alternative thoughts on how something like this could be accomplished?

EDIT: After thinking this through a bit, I should use better terminology. The refresh itself would not be conditional. The refresh always occurs. Based on the parameter settings however, Part of the script would execute or it would call a separate function. Does anyone have a good example of code with logic like that?

Accepted Solutions
Community Support Team
Posts: 4,051
Registered: ‎07-09-2016

Re: Conditional Refresh

@deldersveld,

 

You may take a look at the following article.

https://community.powerbi.com/t5/Community-Blog/Conditional-Code-Branching-in-Power-BI-Query-if-then...

Community Support Team _ Sam Zha
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


All Replies
Community Support Team
Posts: 4,051
Registered: ‎07-09-2016

Re: Conditional Refresh

@deldersveld,

 

You may take a look at the following article.

https://community.powerbi.com/t5/Community-Blog/Conditional-Code-Branching-in-Power-BI-Query-if-then...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advisor
Posts: 363
Registered: ‎06-26-2015

Re: Conditional Refresh

Thanks. This type of logic is exactly what I was after.