Forum Discussion

Mann's avatar
Mann
Resolver III
7 years ago
Solved

Slow running Cumulative total calculation for Calculated Column

Hi Guys,   I created a calculated column calculation to find the running total. Here is the data set. I have Dates, Individual IDs, Logic1 (It is a calculated column which find the breakpoints for...
  • Mann's avatar
    Mann
    7 years ago

    Anonymous 

     

    Thanks to your suggestion! I have changed the calculation to:

    Running Total =
    CALCULATE (
        SUM ( 'Table2'[Logic 1] ),
        FILTER (
            'Table2',
            AND (
                'Table2'[Individual ID]
                    = EARLIER ( 'Table2'[Individual ID] ),
                'Table2'[Index]
                    <= EARLIER ( 'Table2'[Index] )
            )
        )
    )

    And the calculation of Logic 2 to:

    Logic 2 =
    RANKX (
        FILTER (
            'Table2',
            AND('Table2'[Running Total] = EARLIER ( 'Table2'[Running Total]) ,
                'Table2'[Individual ID] = EARLIER('Table2'[Individual ID]))
        ),
        'Table2'[Index],
        ,
        ASC
    )

    Now the columns is getting calculation in less than 1 min than 1hour before.

     

    Thanks!!