- Daily Success Snacks
- Posts
- Still Writing Nested IFs? That’s Why Your Measures Break (And You Know It)
Still Writing Nested IFs? That’s Why Your Measures Break (And You Know It)
If your measure needs scrolling... it’s already broken.

Read time: 2.5 minutes
The harsh reality is that nested IF statements do not enhance your intelligence... rather, they create an unstable model.
When you check your calculations, you see they have grown to 40 lines, full of nested IFs within IFs.
Somehow, everything works!
When you try to modify those calculations in a week, they have now broken down completely, forcing you to fix logic you do not even remember. This was not a clever solution… it was preventable.
How Can You Avoid Writing Code That Will Ultimately Lead to Regret?
1. Use Variables Early (VAR)
Simpler is better than complicated.
• Split logic into discrete steps,
• Clearly name each step.
2. Use SWITCH to Avoid Nested IFs
Order is better than chaos.
• Use SWITCH(TRUE()) to improve readability.
• Use simpler conditions.
3. Create in Steps
Avoid trying to create everything at once.
• Validate each component as you create it.
• Combine once each component works as expected.
4. Create Code that is Readable by Others (and You)
• Include spacing and proper naming.
• Avoid long single-line coding logic that looks brilliant.
5. Optimize After Code is Understandable
Optimize your code for efficiency once it is readable first.
• Code should always be easy to read before optimizing for efficiency.
• Code should be readable before being optimized for speed.
💡Key Takeaway:
Measuring things is difficult when they're very hard to understand.
👉 LIKE this if you’ve ever regretted a nested IF.
👉 SUBSCRIBE now for practical tips on cleaner, smarter data modeling.
👉 Follow Glenda Carnate for more on Power BI, DAX, and building maintainable models.
Instagram: @glendacarnate
LinkedIn: Glenda Carnate on LinkedIn
X (Twitter): @glendacarnate
👉 COMMENT on your longest (or worst) measure ever.
👉 SHARE this with someone still writing IF inside IF inside IF.
Reply