Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Sum Column with Multiple Criteria

Hi All,    Trying to acheive something like this in "New Column", using a DAX function.    I want to sum the Sales values for matching Year, Month, and Cat1 rows.  Year Month Cat1 Cat2 Sa...
  • v-piga-msft's avatar
    6 years ago

    Hi Anonymous ,

    You also could try this calculated column.

    Column =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Year] = EARLIER ( 'Table'[Year] )
                && 'Table'[Month] = EARLIER ( 'Table'[Month] )
                && 'Table'[Cat1] = EARLIER ( 'Table'[Cat1] )
        )
    )
    

    Here is the output.

    Hope this can help you.

    Best Regards,

    Cherry