Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Cummilative sum after a specific month

Hi I want to display the cummilative sum only from August months onward but not able to acheive this .

In Aug , Final FG STK Total should be 221.362 +(-69.45) ( in current it is showing only -69.45) In Sep , Final FG STK Total should be 221.362 +(-69.45) + 10.55  (in current it is showing only 10.55) & so on

 

Stuck in getting those values.

 

  • Hi Anonymous 

    Try this calculated column

    CALCULATE (
        SUM ( 'table'[rolling total] ),
        FILTER (
            ALL ( 'table' ),
            'table'[month] >= 7
                && 'table'[month] <= EARLIER ( 'table'[month] )
        )
    )
    
  • Hi Anonymous ,

     

    You could try below code:-

    Cumulative_Total = 
    VAR CurrentMonth = [Month]
    var _result =   
        CALCULATE(
            SUM('Table (3)'[Rolling_total]),
            FILTER(
                ALL('Table (3)'),
                [Month] <= CurrentMonth && [Month] >= 7
            )
        )
    RETURN IF('Table (3)'[Month] >=8,_result)

    Output:-

     

3 Replies

  • Hi Anonymous 

    Try this calculated column

    CALCULATE (
        SUM ( 'table'[rolling total] ),
        FILTER (
            ALL ( 'table' ),
            'table'[month] >= 7
                && 'table'[month] <= EARLIER ( 'table'[month] )
        )
    )
    
  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous ,

     

    You could try below code:-

    Cumulative_Total = 
    VAR CurrentMonth = [Month]
    var _result =   
        CALCULATE(
            SUM('Table (3)'[Rolling_total]),
            FILTER(
                ALL('Table (3)'),
                [Month] <= CurrentMonth && [Month] >= 7
            )
        )
    RETURN IF('Table (3)'[Month] >=8,_result)

    Output:-