Forum Discussion
admin_xlsior
Post Prodigy
7 years agoCreate fixed measure
Hi guys, I'm trying to create a measure, Total sales last year divide by 12, I already have my Total Sales measure, so I think I just add new measure and use the function SAMEPERIODLASTYEAR lik...
OwenAuger
Super User
7 years agoThe PARALLELPERIOD function should be useful for what you are trying to do.
PARALLELPERIOD lets you expand the date filter to complete months, quarters or years.
For example, you could write this measure to return sales for the entire current year:
Total Sales Current Year =
CALCULATE(
[Total sales],
PARALLELPERIOD ( 'Date'[datekey], 0, YEAR )
)
Then any of these measures are variations that return sales for the entire previous year
Total Sales LY =
CALCULATE(
[Total sales],
SAMEPERIODLASTYEAR ( PARALLELPERIOD ( 'Date'[datekey], 0, YEAR ) )
)
Total Sales LY =
CALCULATE(
[Total sales],
PARALLELPERIOD ( 'Date'[datekey], -1, YEAR )
)
Total Sales LY =
CALCULATE(
[Total Sales Current Year],
SAMEPERIODLASTYEAR ( 'Date'[datekey] )
)
Does that help?
Regards,
Owen