Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
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
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
Perfect, thank you!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |