Forum Discussion
sraj
Responsive Resident
4 years agoLast year vs this year
Hi there,
I have this function looking for 2021 and 2020, is there anyway I can use this and make it to look for Last Year Vs this year? Instead of updating this every year? Please advise.
CALCULATE(
[onsite %new],
HEA_DATE_Detail[Year] = 2021
)
-
CALCULATE(
[onsite %new],
HEA_DATE_Detail[Year] = 2020
)
YEAR ( TODAY () ) and YEAR ( TODAY () ) -1 could be direct replacements in the above.
Hi sraj
Use DATEADD in the filter context of your formulas instead of HEA_DATE_Detail[Year] = 2021
Iike
DATEADD(HEA_DATE_Detail[DATE],0, YEAR) for this yearAndDATEADD(HEA_DATE_Detail[DATE],-1, YEAR) for last year
2 Replies
- bcdobbs
Community Champion
YEAR ( TODAY () ) and YEAR ( TODAY () ) -1 could be direct replacements in the above.