Thursday 15 October 2015

Previous Year YTD formula

if [Order Date] <= [date]-365
and DATEPART('year',DATEADD('month',12,[Order Date])) = DATEPART('year',DATEADD('month',12,[date]-365))
then [Sales]
end



Date is the parameter here..


Option 2:

sum(if year([Order Date]) = year([date])-1 and 
[Order Date] <= dateadd('year',-1,[date]) then [Sales] END)

1 comment:

  1. I feel Tableau is the most and useful aspect and dashboard which helps solving complex IT problems and voluminous operations of database in order to utilise its aspects fully.

    Tableau Soap Connection

    ReplyDelete