Forum Discussion
Anonymous
6 years agoNot applicable
SUM MTD Not working through DateTable
Hi, LeadCount MTD = CALCULATE(SUM(fLeads[LeadCount]), DATESMTD(dDate[Date])) is not working But if I do directly LeadCount MTD = CALCULATE(SUM(fLeads[LeadCount]), DATESMTD(fLeads[DATE_KEY_...
Anonymous
6 years agoNot applicable
Anonymous
Why not?
The field is stated as a date and the Yesterday function is working fine.
Could you please explain what am I missing?
Anonymous
6 years agoNot applicable
Anonymous ,
You have define your types correctly,
as a cheeky solution you can use the same formula as in Yeaterday - 1 (as it works).
Instead of giving static value (2) in the formule
dDate[Date] = Today() - 2
you can use a variables to calculate the number of days in the month and pass it to there.
So your LeadCountMTD would be
VAR Var1 = Count Number of MTD
CALCULATE(
SUM(fLeads[LeadCount),
dDate[Date] = TODAY() - Var1
)
I have being sarcastic 🙂