Forum Discussion
Martin_Songstad
4 years agoFrequent Visitor
Alternative measures vs alternative VARs
Hi!
I have a measure choosing 1 out of 4 other measures, depending on what ISFILTERED, like this:
IB =
VAR __IB= If(
ISFILTERED(Age) && ISFILTERED(Duration), [IB_BothFiltered],
if(ISFILTERED(Age),[IB_AgeFiltered],
If(ISFILTERED(Duration),[IB_DurationFiltered],[IB_NeitherFiltered])))
RETURN if(__IB>0,__IB)The purpose is to choose the alternative which calculates faster, when possible.
Now I am contemplating replacing those 4 measures with 4 VARs within the main measure instead, but what would happen then? Would all 4 VARs be calculated in the background only for one of them to show up, or would only the VAR that that shows up be calculated?
Martin_Songstad , I think var is evaluated once, even if not used.
refer
https://www.purplefrogsystems.com/blog/2021/09/variables-in-dax/
1 Reply
- amitchandak
Super User
Martin_Songstad , I think var is evaluated once, even if not used.
refer
https://www.purplefrogsystems.com/blog/2021/09/variables-in-dax/