Forum Discussion
Get previous YYYY-MM value based on existing YYYY-MM value
- 5 years ago
009co , As long as YYYYMM is coming from the calendar table, that should not give issue.
Measure is correct
Actual PY = CALCULATE([Actual],DATEADD('Calendar'[Date],-1,YEAR))
Check -
calendar table is marked as date table
It has previous year dates in the date column. I doubt you need date PY
So for this year date column should have date for 2020 too
The Fact Date should not have any timestamp
Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw
RE first suggestion, was it to create a new column with a variable and result to be returned as follows? This didn't create any errors, but was just blank:
Measure =
VAR
PY = FORMAT(DATEADD('Calendar'[Date],-1,YEAR), "YYYY")
RETURN
CALCULATE([Actual], 'Calendar'[Year] = PY)
RE second suggestion, it just returns the current year actual value:
Apologies, I didn't know you were trying to make a column, I thought it was a measure.
I will bow out here as I am unsure!