Forum Discussion
Syndicate_Admin
3 years agoAdministrator
DATEADD returns blank value
Estimated. I have the following problem with some DAX formulas, where I want to calculate last year's sales using DATEADD. The formulas would be as follows: 1) LYTD = CALCULATE([YTD],DATEAD...
v-yalanwu-msft
3 years agoCommunity Support
Hi, Syndicate_Admin ;
Try it.
Ytd = CALCULATE(SUM('Table'[value]),DATESYTD('Table'[Date]))Lytd =
var _max=CALCULATE(MAX('Table'[Date]),ALL('Table'))
return CALCULATE(SUM('Table'[value]),FILTER('Table',[Date]>=DATE(YEAR( _max)-1,1,1)&&[Date]<=DATE(YEAR(_max)-1,MONTH(_max),DAY(_max))))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.