Forum Discussion

Pikachu-Power's avatar
Pikachu-Power
Impactful Individual
3 years ago
Solved

Slow performance in Matrix / Measure optimization

Hello community,   I created a matrix and the results are fine. But when I switch slicer from 2020 to 2021 it takes 14000 ms. When I enable the subtotals 6600 ms. Is that normal or would some optim...
  • johnt75's avatar
    3 years ago

    Using variables might improve performance

    Measure1 =
    VAR MaxEndDate =
        MAX ( TABLE[END_DATE] )
    VAR YearEnd =
        DATE ( SELECTEDVALUE ( CALENDER[YEAR] ), 12, 31 )
    RETURN
        IF (
            ISBLANK ( MaxEndDate ),
            YearEnd,
            IF ( MaxEndDate <= YearEnd, MaxEndDate, YearEnd )
        )