Forum Discussion
KCinMelbourne
7 years agoResolver I
How to End a Query if Condition is Met (Query Editor / M)
Hi all,
I am looking for a solution that says:
if <condition> then <perform action> else <end query>
Is this possible in M?
Also there are a number of queries where if a condition is met, I effectively don't want the query to execute at all. Is that possible? For example:
if <Parameter A = "Disable"> then <end query without any content> else <query actions>
Cheers
Kirsty
Hi KCinMelbourne,
Please check if below blog helpful to your scenario:
Conditional Code Branching in Power BI Query: if...then...else => then...else...if
Best regards,
Yuliana Gu
2 Replies
- v-yulgu-msftMicrosoft Employee
Hi KCinMelbourne,
Please check if below blog helpful to your scenario:
Conditional Code Branching in Power BI Query: if...then...else => then...else...if
Best regards,
Yuliana Gu
- KCinMelbourneResolver I
Perfect, thank you!