Forum Discussion

31415926's avatar
31415926
New Member
4 years ago
Solved

Year to Year only show specific values

Hi,   I wanted to present the sales of 2021 and 2022 with YOY change %. YOY = DIVIDE(([Total Sales This Year]-[Total Sales Last Year]),[Total Sales Last Year]) As you can see below, the YOY val...
  • johnt75's avatar
    4 years ago
    YOY % =
    var currentSales = [Total Sales This Year]
    var prevSales = [Total Sales Last Year]
    return IF( currentSales > 0, DIVIDE( currentSales - prevSales, prevSales ) )

    will only return a value if there are sales for this year, otherwise it will return blank