Forum Discussion
December last year value
Hello!
I have a fact table which has Sales values. I also have a date table and fact and date table are mapped. My question is, I have to calculate a month value for december last year. Say if the report month/year filter is 06.2019, then december last year will be sales for december 2018. if the report month/year filter is 06.2018, then december last year will be sales for december 2017 and so on. How can I calculate this december last year measure?
Regards
PV
2 Replies
- OwenAugerSuper User
Hello PV
There are a various ways you could do this. Here is one that springs to mind:
Sales Previous December = CALCULATE ( [Sales], PREVIOUSYEAR ( 'Date'[Date] ), 'Date'[Month] = 12 )Regards,
Owen
- daxCommunity Support
Hi PiaV,
I am not clear about your requirement, you said that "Say if the report month/year filter is 06.2019, then december last year will be sales for december 2018", did you mean when you choose slicer 2019.06, you need to get 2018.12, but if you chooe 2019.05, which month do you want to get ? Or no matter month you choose, you just want to the last month of previous year? If possible, could you explain it in details? Then I will help you more correctly.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.