Forum Discussion
vijay273162
Helper III
4 years agoSAME PERIOD LAST YEAR
Hi All, basic Question from my side. HOW TO USE SAME PERIOD LAST YEAR ---- in ----- calculated columns ?
- 4 years ago
Hi vijay273162
If you are using dates from a fact table, try this way,
column = VAR _date = EDATE ( 'Table'[Date], -12 ) RETURN CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( ALL ( 'Table' ), 'Table'[Date] >= _date && 'Table'[Date] < EARLIER ( 'Table'[Date] ) ) )If you want to create measure, then try this
LY = CALCULATE(SUM('Table'[Sales]),SAMEPERIODLASTYEAR('Table'[Date]))Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Ikalaus
2 years agoFrequent Visitor
I have another solution for how to calculate last year same-month
Last year revenue = CALCULATE(
SUM( 'table'[revenue]),
FILTER(
'table',
'table'[month/date] = DATE( YEAR(TODAY()) - 1, MONTH(TODAY()), 01)
)