Forum Discussion

Zilliox's avatar
Zilliox
Helper IV
5 years ago
Solved

Optimize Dashboard

Hi, I have created several measures, but it is not really optimize. When I publish it, it takes to long before I have the numbers in the Payout visual.   I have done a performance analyze and this...
  • mahoneypat's avatar
    5 years ago

    Actually, I tried one more thing to optimize one of the dependent measures.  Using this one instead gets it under 400 ms.

     

    YTD Commission Payout -1Month =
    VAR vMonths =
        CALCULATETABLE (
            VALUES ( Dates[Year Month] ),
            FILTER (
                ALL ( Dates ),
                Dates[Date]
                    MIN ( Dates[Date] )
            )
        )
    VAR vSummary =
        ADDCOLUMNS (
            vMonths,
            "cYTDComm", [YTD Commission]
        )
    VAR vMaxMonth =
        MAXX (
            FILTER (
                vSummary,
                [cYTDComm] > 0
            ),
            Dates[Year Month]
        )
    RETURN
        SUMX (
            FILTER (
                vSummary,
                Dates[Year Month] = vMaxMonth
            ),
            [cYTDComm]
        )

     

    Regards,

    Pat