Forum Discussion

tomekm's avatar
tomekm
Icon for Helper III rankHelper III
5 years ago
Solved

Dinamic Month over Month change calculation

Hi,   I'm trying to create a column that will show the "Change" in Volume for each ID. Please see table below. If I filter on a specific month, I'd like to see the total of Changes for each ID numb...
  • v-yalanwu-msft's avatar
    5 years ago

    Hi, tomekm ;

    Please try:

    new column = 
    VAR _last =
        EOMONTH ( [Periods_Table], -1 )
    RETURN
        IF (
            [Periods_Table]= CALCULATE ( MIN ( [Periods_Table] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) ),
            0,
            [Volume]- CALCULATE (SUM ( [Volume] ), FILTER (
                        ALLEXCEPT ( 'Table', 'Table'[ID] ),
                        EOMONTH ( [Periods_Table], 0 ) = _last)))

    The final output is shown below:

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.