Forum Discussion
Twister8
Helper II
9 years agosum values with the last date (month)
hello everyone, I am new in PB and DAX, I need calculate the sum of values from the last month with data on my database, for example: month values 2016-1 1 2016-2 5 2016-3 ...
- 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)
SPMoore
Advocate I
9 years agoHi Twister8
You can use the CALCULATE function with the LASTNONBLANK function as its filter argument, you will get a result of 20.
Measure = CALCULATE(SUM(Table1[value]),LASTNONBLANK(Table1[date],1))
Let me know if it works out.
Simon
SPMoore
Advocate I
9 years agops - there is an excellent tutorial on LASTNONBLANK here:
http://exceleratorbi.com.au/lastnonblank-explained/