Calculating average units for two years
Hello. I am trying to calculate the average of my 2022 and 2023 unit totals. This metric is calculated by doing a DUPCOUNT([AccountId]) in my widget. Yes, I am using the dupcount on purpose. I tried making a custom column to calculate the totals for each year so i could then do ([# of 2022 Units] + [# of 2023 Units]) / 2 to get my average.
SELECT COUNT([AccountId])
FROM [Table]
WHERE GETYEAR([CreatedDate]) = 2022
but that's not doing what I expected. Whenever I do a COUNT it's essentially the same as if I didn't use a date filter. Ultimately, I am trying to get the 2024 units total divided by the average of 2022 and 2023 unit totals to get my run rate. Please help. If I try doing this in my EC, it wants me to group by, but that will interfere with my dashboard. Thank you.