Forum Discussion
Show total only last month
- 9 years ago
HI,
Tks everybody for answers...
I solved:
Column
LastMonth = IF(YEAR(TODAY())= YEAR('Fact'[Date]) && MONTH(TODAY())-1 = MONTH('Fact'[Date]);1;BLANK())
Measure
Mymeasure = CALCULATE(SUM('Fact'[Value]);'Fact'[LatMonth] =1)
Hi Twister8,
You can try to use below formula if it works on your side:
Total of last month =
var currDate=MAX(Tempo[Date])
return
SUMX(FILTER(ALL(Tempo),currDate>= DATE(YEAR(currDate),MONTH(currDate)-1,1)&&currDate<=DATE(YEAR(currDate),MONTH(currDate),1)-1),[VALUE])
Regards,
Xiaoxin Sheng
- Twister89 years agoHelper II
HI,
Tks everybody for answers...
I solved:
Column
LastMonth = IF(YEAR(TODAY())= YEAR('Fact'[Date]) && MONTH(TODAY())-1 = MONTH('Fact'[Date]);1;BLANK())
Measure
Mymeasure = CALCULATE(SUM('Fact'[Value]);'Fact'[LatMonth] =1)
- alanhanssen9 years agoFrequent Visitor
Hi,
Your formula might have failed by now as the current year is not anymore the same as YEAR('Fact'[Date]) but still is last month.
I created a measure as the key for identifying
LastMonth = if(MONTH(TODAY())-1=0,12,MONTH(TODAY()-1)) &" "& (YEAR(TODAY())-1)
Also a column for identifying those.
IsInLastMonth = IF(DateTable[MonthAndYear]=[LastMonth],TRUE(),FALSE())