Forum Discussion
raymondpocher
Advocate III
5 years agoReferencing to Measure or rather working with variables?
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 r...
Anonymous
5 years agoNot applicable
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.