Forum Discussion

jak8282's avatar
jak8282
Icon for Helper III rankHelper III
3 years ago
Solved

Create a calculated running column based on week commencing total

Hi,   I have a table which I bring which looks like   Datekey      WC               Forecast    Region 20221121    20221121    61              Africa 20221122    20221121    61              Afr...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi jak8282 ,

    You can update the formula of calculated column [Running Total] as below, please find the details in the attachment.

    Running Total = 
    VAR _rtforecast =
        CALCULATE (
            SUM ( 'Table'[Forecast] ),
            FILTER (
                'Table',
                'Table'[Region] = EARLIER ( 'Table'[Region] )     
                    && 'Table'[Datekey] <= EARLIER ( 'Table'[Datekey] )
            )
        )
    RETURN
        DIVIDE ( _rtforecast, 7 )

    Best Regards