Forum Discussion
tryan
9 years agoFrequent Visitor
calculate function
I need some help understanding how the SUMIFS function works in DAX for power pivot. I've read that some combination of CALCULATE and FILTER works, but I can't get it to work dynamically with my 6,0...
- 9 years ago
Ok I read your post too fast... here it is you were actually very close
Column / Measure = CALCULATE ( SUM ( 'Table'[Transaction Amount] ), FILTER ( ALL ( 'Table'[Transaction Type] ), 'Table'[Transaction Type] = "Withdrawal" || 'Table'[Transaction Type] = "Addition" ), ALLEXCEPT ( 'Table', 'Table'[Client Number], 'Table'[Month] ) )Good Luck! :smileyhappy:
https://www.sqlbi.com/articles/filter-arguments-in-calculate/
Sean
9 years agoCommunity Champion
Ok I read your post too fast... here it is you were actually very close
Column / Measure =
CALCULATE (
SUM ( 'Table'[Transaction Amount] ),
FILTER (
ALL ( 'Table'[Transaction Type] ),
'Table'[Transaction Type] = "Withdrawal"
|| 'Table'[Transaction Type] = "Addition"
),
ALLEXCEPT ( 'Table', 'Table'[Client Number], 'Table'[Month] )
)Good Luck! :smileyhappy:
https://www.sqlbi.com/articles/filter-arguments-in-calculate/
tryan
9 years agoFrequent Visitor
Awesome, thanks again! Your method works in addition to my own post that used separate CALCULATE functions for each transaction type of "Addition" and "Withdrawal". But your solution is simpler since it's more efficient if there are more than two transaction types that I'd need to filter on.