Forum Discussion

Martin_Songstad's avatar
Martin_Songstad
Frequent Visitor
4 years ago
Solved

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?