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

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