This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello Community,
Usually I create a lot of measures and even use nested measures as well. But now I am wondering if thats a best practice approach. Should I use variables rather than nesting or referencing to other measures?
An example for calculating a simple ratio.
Approach 1 with nestes measures:
Approach 2 with variables:
What do you think?
As usual, IT DEPENDS. If you have defined meaningful business measures, then you should reuse them as much as possible because code duplication is the first step to hell. You should catch measure values into variables most of the time and give them good names. Remembering at that that a measure's value stored in a variable will never change. This is helpful when used correctly. Also, using variables is very beneficial when debugging code. The rule I go by is: If your expression is short, you don't need to catch everyching into variables because the short code (with well named measures) speaks for itself. If your expression is complex, use variables with good names.
Hi @raymondpocher ,
For me Approach 2 works better. There are few reasons for using variables rather than multiple measures:
This is my view, but I am sure others will have more to add to this.
Thanks,
Pragati
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 7 | |
| 6 | |
| 6 |