Forum Discussion
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 Award Payments'!F:F,'Education Award Payments'!E:E,Sheet1!E6,'Education Award Payments'!G:G,Sheet1!$I$5:$J$5)) forumla to get the values for each participant, but I'm just not sure what the DAX formula would be to get the same results.
Column E Column F Column G
| Name | Amount | Status |
| Participant 1 | $1,126.00 | OK to Pay |
| Pasrticipant 1 | $76.95 | Hold |
| Participant 1 | $750.00 | Paid |
| Participant 2 | $690.00 | Cancel |
| Participant 2 | $89.25 | OK to Pay |
| Participant 3 | $157.93 | OK to Pay |
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") )
5 Replies
- jgeddes
Super User
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") )- ofi2023Regular Visitor
Thank you so much! This is exactly what I was looking for.
- ryan_mayu
Super User
- AnonymousNot applicable
Hi ofi2023 ,
Your solution is great, ryan_mayu / jgeddes . It worked like a charm! Here I have another idea in mind, and I would like to share it for reference.
Please try:
Create a measure:
Total Amount = SUMX( CALCULATETABLE( 'Table', 'Table'[Status] IN {"OK to Pay", "Paid"} ), 'Table'[Amount] )In the final page the effect is shown below:
The pbix file is attached.
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!- ofi2023Regular Visitor
This is a great alternative! It wasn't exactly what I was looking for since it separated the status instead of combining them but this will be useful for other situations.