Forum Discussion
powerbihelp87
6 years agoHelper V
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...
- 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] )
parry2k
6 years agoSuper User
powerbihelp87 try this measure
SUM ( 'Test Table'[Amount]),
'Test Table','Test Table'[Code] IN {"10023","10039"},
'Test Table'[Category] IN {"az""ac"}
)
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡