
Hi All,
I need a little help on how to create a calculation in Tableau (sample dataset attached). I want to take (current year sales - ((last year’s sales/250)*number of YTD fiscal days in for current year)). I will need it to use the current YTD selling days even if there are no sales for that month.
Example 1:
Sales YTD 2022 = $55,000
Sales 2021 = $100,000 / 250 = $400
Days in through June = 121
$400*121 = $48,400
$55,000 - $48,400 = $6,600
Example 2:
Sales YTD 2022 = $0
Sales 2021 = $100,000 / 250 = $400
Days in through June = 121
$400*121 = $48,400
$0 - $48,400 = -$48,400
Example 3:
Sales YTD 2022 = $55,000
Sales 2021 = $0 / 250 = $0
Days in through June = 121
$0*121 = $0
$55,000 - $0 = $55,000
Thank you for your help!
1 answer