Forum Discussion
toncib
7 years agoNew Member
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.
- 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])
Greg_Deckler
7 years agoCommunity Champion
See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
toncib
7 years agoNew Member
It might, but that is YTD and I'm not experienced enough to understand how to do this for the MTD that I need.
- Greg_Deckler7 years agoCommunity Champion
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])