Forum Discussion
jfranco
2 years agoFrequent Visitor
DAX Calculated Column - Value from a same date previous year
Hello and Good Morning. I have another question from the knowledge base. I have the following table: ID Location Date Production A North 01/01/2024 10 B North 01/01/2024 ...
- 2 years ago
Thank you Anonymous
Thank you!
Almost but not quite.
I ended up creating two columns
M = Month(Table[Date])
PY = Year(Table[Date])
and then using a variation of your DAX code :
CALCULATE (SUM([Production)]),FILTER(ALL(Table),Table[ID]=EARLIER(Table[ID])&& Table[Location] = EARLIER(Table[Location])&& Month(Table[Date]) = Earlier(Table[M])&& Year(Table[Date]) = EARLIER(Table[PY]) )))Gracias
Roger
jfranco
2 years agoFrequent Visitor
Further.
This is the DAX formula I am using, but it returns blanks:
Prev Year Tot Prod = CALCULATE ( SUM( TABLE [Production]), SAMEPERIODLASTYEAR([Date]))