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

Conditional Refresh

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?
1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@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

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@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.

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

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.