Forum Discussion
sum values with the last date (month)
- 9 years ago
HI,
Tks everybody for answers...
I solved:
LastMonth = IF(YEAR(TODAY())= YEAR('Fact'[Date]) && MONTH(TODAY())-1 = MONTH('Fact'[Date]);1;BLANK())
Mymeasure = CALCULATE(SUM('Fact'[Value]);'Fact'[LatMonth] =1)
So you don't have other date columns?
I can only duplicate this issue when you are using the wrong Date column in the Fact table for your relationship to the Date table.
For example if you want to SUM the Payment amounts you'll use the Payment Date (Oct 1, 2016) not Order Date (Aug 31, 2016)
Meaning the relationship has to be Payment Date column to Date column in Calendar (Not Order Date to Date)
HI,
Tks everybody for answers...
I solved:
LastMonth = IF(YEAR(TODAY())= YEAR('Fact'[Date]) && MONTH(TODAY())-1 = MONTH('Fact'[Date]);1;BLANK())
Mymeasure = CALCULATE(SUM('Fact'[Value]);'Fact'[LatMonth] =1)