I am working on a simple dashboard that will show Daily, Week to Date, Month to Date, and Year to Date totals for a product. My underlying data is a list of sales including the date they occurred and the total amount of the sale. I am using the following calculated field to create buckets for the dates
IF [Date] = TODAY() THEN "Today"
ELSEIF DATETRUNC('week', [Date]-1)+1 <= TODAY()
AND DATEDIFF('week',DATETRUNC('week', [Date]-1)+1, TODAY()) = 0
AND MONTH([Date]) = MONTH(TODAY())
AND YEAR([Date]) = YEAR(TODAY()) THEN "WTD"
ELSEIF MONTH([Date]) = MONTH(TODAY())
AND YEAR([Date]) = YEAR(TODAY()) THEN "MTD"
ELSEIF YEAR([Date]) = YEAR(TODAY()) THEN "YTD" END
My problem is that this doesn't let me sum the buckets so that MTD includes the WTD values, etc. I've looked at a similar SO post but that solution isn't what I am trying to accomplish. Rather than seeing the values for each day I want a small table that just shows totals for each category, e.g.
VOLUME
Daily ####
WTD ####
MTD ####
YTD ####