Forum Discussion
retrieving average value for base year, by segments
- 1 year ago
If you want to do date math you will want to add a calendar table to your data model.
Calc 2019 Avg = var yd = 2019-max('Calendar'[Year]) return CALCULATE(AVERAGE(Sheet1[value]),DATEADD('Calendar'[Date],yd,YEAR))see attached.
- 1 year ago
which values do you think are incorrect? Remember that 2024 isn't complete yet.
Thanks Ibedlin ! That works for calculating the Avg in year by Category (in this case post code). But what about calculating the % change from 2019 Avg by Category ? In the attached this didn't pull back correct values ? using :
which values do you think are incorrect? Remember that 2024 isn't complete yet.
- dp_751 year agoFrequent Visitor
Thanks Ibendlin - solution works for comparing years to 2019 base year, but as you say will not work for part year 2024. Will need another solution to detected year to date 2024 data and compare to same year to date position for 2019, or full 2019 base year.
- lbendlin1 year ago
Super User
My solution works for YTD - that should be acceptable. No point in comparing partial 2024 to full 2019.