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)
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 ) )
2 Replies
- SeanCommunity 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 ) )- AnonymousNot applicable
Seanworked, easy, i love this place!! thanks!