Forum Discussion

rlsantos's avatar
rlsantos
Frequent Visitor
4 years ago
Solved

MEASURE YY% WORKING SLOW

Hi everyone!

Who can help me with this?

I have a simple mesure tha calculate % in same period from last year.

REAL SALES YY%:=IFERROR([REAL SELLIN]/CALCULATE([REAL SELLIN];DATEADD(d_DATES[DATES];-1;YEAR))-1;0)

This measure is Working very very Slow, can enyone tell me whats wrong?

 

  • smpa01's avatar
    smpa01
    4 years ago

    rlsantos  can you try using the variables and see if it improves the performance

    Measure:=
    VAR _0 = [REAL SELLIN]
    VAR _1 = CALCULATE(_0, SAMEPERIODLASTYEAR(d_DATES[DATES]))
    VAR _2 = DIVIDE(_0,_1)
    RETURN IFERROR(_2,0)

5 Replies

    • rlsantos's avatar
      rlsantos
      Frequent Visitor

      I've already tried, but it doesn't matter, it's slow

      • smpa01's avatar
        smpa01
        Community Champion

        rlsantos  can you try using the variables and see if it improves the performance

        Measure:=
        VAR _0 = [REAL SELLIN]
        VAR _1 = CALCULATE(_0, SAMEPERIODLASTYEAR(d_DATES[DATES]))
        VAR _2 = DIVIDE(_0,_1)
        RETURN IFERROR(_2,0)