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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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