Forum Discussion

anelliaf's avatar
anelliaf
Icon for Helper II rankHelper II
6 years ago

Last MTD Formula

I'm using the following Last MTD Costs formula to show a floating cost total in a card.  It's showing BLANK.

 

Last MTD Costs = CALCULATE(SUM('Usage Details - 2'[Cost]),PREVIOUSMONTH(dateDimension[Date]))

 

I have a similar formula for Last YTD total which is working.  No interaction is set with other filters.

Any ideas?

 

15 Replies

  • anelliaf 

    Try like

     

    MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
    last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
    last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
    last year MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
    last year MTD Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
    
    
    last QTR same Month (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,Qtr))))
    
    
    MTD (Year End) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR('Date'[Date])))
    MTD (Last Year End) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR(dateadd('Date'[Date],-12,MONTH),"8/31")))
    

     

     

    • anelliaf's avatar
      anelliaf
      Icon for Helper II rankHelper II

      I tried using the formula:

       

      last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

       

      It's still showing as BLANK.

       

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        Are you getting data for MTD. Have you selected any date or not. If you have not selected any date the MTD will start from the last month of the calendar.