Forum Discussion
ChPetru
Helper I
4 years agoPoor performance IF measure
Hello, I have created a measure that has horrible performance: _Active License =
VAR ExpiresInFuture =
LASTDATE ( LineItem[Opportunity Line End Date] )
>= LASTDATE ( ReferenceDate[...
PabloDeheza
Solution Sage
4 years agoHi there!
One thing you can try is splitting the variables so you dont make the engine compute the same thing multiple times. The engine is sometimes smart enough to realise that something was already computed but not always.
Try one variable for
LASTDATE ( LineItem[Opportunity Line End Date] )
One for
LASTDATE ( ReferenceDate[Reference Date] )
And one for
FIRSTDATE ( LineItem[Opportunity Line Start Date] )
Variables are only computed once, since you are using one of those expression 4 times, that should help at least something on your performance.
Let me know if that helps!
ChPetru
Helper I
4 years agoSorry, it did not help at all. I actually broke down the measure to:
_License Active =
IF (
FIRSTDATE ( LineItem[Opportunity Line Start Date] )
<= LASTDATE ( ReferenceDate[Reference Date] )
&& LASTDATE ( LineItem[Opportunity Line End Date] )
>= LASTDATE ( ReferenceDate[Reference Date] ),
TRUE (),
FALSE ()
)
and it still has huge performance issues.
How can I optimize this?