Forum Discussion

ofi2023's avatar
ofi2023
Regular Visitor
2 years ago
Solved

SUMIFS DAX Equivalent

I'm new to PowerBI and DAX and I've been stuck trying to creating a measure to sum the Amount column if the Status is either "OK to Pay" or "Paid". In excel, I would use the =SUM(SUMIFS(Education Awa...
  • jgeddes's avatar
    2 years ago

    Any of the following would work...

    Sum1 = 
    SUMX(
        FILTER('Table', 'Table'[Status] IN {"OK to Pay", "Paid"}),
        'Table'[Amount]
    )
    Sum2 = 
    SUMX(
        FILTER('Table', 'Table'[Status] = "OK to Pay" || 'Table'[Status] = "Paid"),
        'Table'[Amount]
    )
    Sum3 = 
    CALCULATE(
        SUM('Table'[Amount]),
        OR('Table'[Status] = "Ok to Pay", 'Table'[Status] = "Paid")
    )