Forum Discussion

AlexIsac16's avatar
AlexIsac16
Regular Visitor
2 years ago

TotalMTD not working properly

Hi all,

 

I'm not sure if there's something staring me in the face here, but I have been playing around with some basic data trying to test a formula, and I encountered an issue with the TotalMTD function. 

 

When using TotalMTD, the visual seems to return the number of units sold for the entire month of September, even though today is 24th Sept. I also tried = CALCULATE(SUM('Table'[Units Sold]),DATESMTD('Table'[Date])) and the figure once again sums up the units for the entire month? Am I missing something very obvious here? 

 

  

2 Replies

  • Time intelligence functions often function in a counter-tuitive way; its calculation NEVER bases on real life date but evaluation context.

  • Hi,

    Assuming you have a Calendar Table with calculated column formulas for Year, Month name and Month number. ensure that the Month name is sorted by the Month number.  To your visual, drag Year and Month name from the Calendar Table.  Write this measure

    Measure = calculate(sum(Table[Units sold]),datesbetween(calendar[Date],min(calendar[date]),today()))

    Hope this helps.