Forum Discussion
akoita92
4 years agoFrequent Visitor
Last 12 months except current month
Hi there, I come to solicit the forum because I am confronted with a problem concerning the calculation of a measurement. I thank you in advance. I would like to sum the last 12 months without ...
- 4 years ago
I did some digging and this code works.
My Calc =CALCULATE (SUM(price),DATESINPERIOD (date,EDATE(MAX ( date ),-1),-12,MONTH))
Thank for your help.
ToddChitt
Super User
4 years ago(this suggestion is 'airware' and may not be sytactically correct for DAX)
My Calc = CALCULATE (SUM('some table'[some column]), 'Date'[Date] > DATEADD(-12,MONTH, NOW() ), 'Date'[Date] <= NOW() )
The above may work for days, but since you want months, you may need to adjust it a little.
akoita92
4 years agoFrequent Visitor
I did some digging and this code works.
My Calc =
CALCULATE (
SUM(price),
DATESINPERIOD (
date,
EDATE(MAX ( date ),-1),
-12,
MONTH
)
)
Thank for your help.
Thank for your help.