Forum Discussion

WilliamKMS's avatar
WilliamKMS
Frequent Visitor
4 years ago
Solved

Previous Year Prorate MTD Calculation

Dear all, Hope you guys have a great day. I have some issues trying to make a prorate previousYear MTD calculation, in my case the fact data is comprised of sales amount and date of the sales, ...
  • amitchandak's avatar
    4 years ago

    WilliamKMS , Please check the measure and the alternate in comments for return

     

    LYMTD QTY forced=
    var _max = date(year(today())-1,month(today()),day(today()))
    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)