Forum Discussion

mike_asplin's avatar
mike_asplin
Icon for Helper V rankHelper V
8 months ago
Solved

Surprisingly slow measure

Hi. Looking for some advice to speed up this measure which is surprsingly slow   FTEs Purchased new = AVERAGEX(ADDCOLUMNS(SUMMARIZE(DateTable,DateTable[MonthYear]), ...
  • v-veshwara-msft's avatar
    v-veshwara-msft
    8 months ago

    Hi mike_asplin ,

    Thanks for sharing the PBIX file.

    Please try the following version of the measure. It keeps the same calculation logic as your original approach but removes the use of SUMMARIZE and ADDCOLUMNS, which are contributing to the performance issue:

    AVERAGEX (
        VALUES ( DateTable[MonthYear] ),
        SUMX (
            VALUES ( Client[Client ID] ),
            CALCULATE (
                MAX ( Client[FTE Prev 30 days] )
                    * [Distinct Paying Clients ex Canc]
            )
        )
    )

    This also avoids the “single value cannot be determined” error by explicitly resolving the client level FTE value.

     

    Attached pbix file for reference.

    Hope this helps.
    Please reach out for further assistance.
    Thank you.