Forum Discussion
Anonymous
9 years agoNot applicable
Sum value by date
Any1 know what's wrong with below DAX? 2017Exp = calculate(sum(XeroMasterExport[ActualExp]),XeroMasterExport[Date]=2017)
- 9 years ago
Yes you need to use the YEAR function
2017Exp = CALCULATE ( SUM ( XeroMasterExport[ActualExp] ), YEAR ( XeroMasterExport[Date] ) = 2017 )HTH! :smileyhappy:
EDIT: Well you may need to use this instead if you are using any slicers that cause the above to give you blank
2017Exp = CALCULATE ( SUM ( XeroMasterExport[ActualExp] ), FILTER ( ALL ( XeroMasterExport ), YEAR ( XeroMasterExport[Date] ) = 2017 ) )
Sean
9 years agoCommunity Champion
Yes you need to use the YEAR function
2017Exp =
CALCULATE (
SUM ( XeroMasterExport[ActualExp] ),
YEAR ( XeroMasterExport[Date] ) = 2017
)HTH! :smileyhappy:
EDIT: Well you may need to use this instead if you are using any slicers that cause the above to give you blank
2017Exp =
CALCULATE (
SUM ( XeroMasterExport[ActualExp] ),
FILTER ( ALL ( XeroMasterExport ), YEAR ( XeroMasterExport[Date] ) = 2017 )
)Anonymous
9 years agoNot applicable
Seanworked, easy, i love this place!! thanks!