Forum Discussion
ADP007
Helper IV
9 years agoTOTALYTD not working
Hi, Really can't figure out why TOTALYTD is not working. Have seen the tutorial, read the posts here but can't get it to work. I'm trying to have a running sum for each month. Any help is...
Dog
Responsive Resident
9 years agoHi David,
the previous full year is returning a total of all salesnet for 2014 as there are no dates in the date table.
there are two options I suppose, you could populate those 2014 dates in the DimDate table which would return a blank for the joined records.
or
amend the measure to manually work out the start and end dates of the previous year and only return data if these are populated.
Previous Full Year Sales =
var startdate = DATEADD(STARTOFYEAR(DimDate[BK_Calendar]), -1, YEAR)
var enddate = DATEADD(ENDOFYEAR(DimDate[BK_Calendar]), -1, YEAR)
RETURN
IF(ISBLANK(startdate) || ISBLANK(enddate),blank(), CALCULATE([SumOfSales], ALL(DimDate), DATESBETWEEN(DimDate[BK_Calendar], startdate, enddate)))
Dog.
ADP007
Helper IV
9 years agoGreat stuff. Thanks again.