Forum Discussion

toncib's avatar
toncib
New Member
7 years ago
Solved

TOTALMTD Not Working

I cannot get TOTALMTD to work.  I need the MTD Scrap Pounds to be added up for the month, but it is just returning the lbs for each instance that day.  Any help is appreicated.
  • Greg_Deckler's avatar
    Greg_Deckler
    7 years ago

    Probably something along the lines of:

     

    TITHW_TotalMTDHW = 
    VAR __MaxYear = MAX('Years'[Year])
    VAR __MaxMonth = MAX('Months'[MonthSort])
    VAR __TmpTable = CALCULATETABLE('TheHardWay',ALL('Years'[Year]),All('Months'[Month]))
    RETURN SUMX(FILTER(__TmpTable,[Year]=__MaxYear && [MonthSort] = __MaxMonth),[Value])