Forum Discussion

powerbihelp87's avatar
6 years ago
Solved

Help with DAX for SumX and Filter function on multiple columns

I need to calculate the sum of two columns based on filters. I tried:   SUMX(FILTER('Test Table','Test Table'[Code="10023" || 'Test Table'[Code]="10039" && 'Test Table'[Category]="az" && 'Test Tabl...
  • AntrikshSharma's avatar
    6 years ago

    Try this:

    =
    SUMX (
        FILTER (
            ALLSELECTED ( 'Test Table' ),
            ( 'Test Table'[Code] = "10023"
                || 'Test Table'[Code] = "10039" )
                && ( 'Test Table'[Category] = "az"
                || 'Test Table'[Category] = "ac" )
        ),
        'Test Table'[ Amount]
    )