Forum Discussion
Anonymous
3 years agoNot applicable
Year to year difference
How do i calculate year to year diffrence if my data type is in a whole number and not in "date" datatype. I only have sales data for 2021 and 2022. There are no month and day data. Most of tutorial/...
FreemanZ
Super User
3 years agohi Anonymous
supposing you have a table like:
| Year | Sales |
| 2020 | 6 |
| 2021 | 8 |
| 2022 | 9 |
| 2023 | 8 |
try to add a calculated column like:
YoY =
VAR _salespre =
MAXX(
FILTER(
data,
data[Year]=EARLIER(data[Year])-1
),
data[Sales]
)
RETURN
IF(
_salespre<>BLANK(),
[Sales]-_salespre
)
it worked like: