Forum Discussion
monojchakrab
Resolver III
3 years agoTotalling error in MTD sales
Hi All, Here is a screenshot of the dashboard which is showing wrong totals : The total in the MTD column for Feb is wrongly being calculated (the actual number if added from the base f...
amitchandak
Super User
3 years agomonojchakrab , Try like
LMTD QTY forced=
Var _Maxdate = MAX('Date Table'[Date])
var _max = date(year(_Maxdate),month(_Maxdate)-1,day(_Maxdate))
return
if(max('Date'[Date])<=_max, CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max), blank())
//OR
//CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)
//TOTALMTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)
Comments are alternate options