Forum Discussion
Need help with Cumulative (Running) Total
Hi,
looking at your initial measure I imagine that it's trying to sum sales within the LY YTD measure that occured before the end of each month in the current year which would always be the end of year total.
do you have a dates table? this would make this a lot easier I think.
not sure if it helps but this is how I usually do things.
Create a measure that just totals the sales
SumOfSales:=sum(PBI_Invoice_Multi[Ext Sales Amount])
I'd expect this to be filtered within the visual of the PBI report page but your main sales should be as straight forward as the following .
This Year Sales:=Calculate([SumOfSales],FILTER(Dates, Dates[Year] = YEAR(TODAY())))
create a new measure for the running total.
Cumulative This YTD Sales:=CALCULATE([SumOfSales], ALL(Dates[DateKey]), datesytd(Dates[DateKey], "12/31")
then use the previous measures to get the previous year information
Last Year Sales:=CALCULATE([This Year Sales], SAMEPERIODLASTYEAR(Dates[DateKey]))
Cumulative Last Year YTD Sales:=CALCULATE([Cumulative This YTD Sales], SAMEPERIODLASTYEAR(Dates[DateKey]))
not sure if this helps any...
Dog,
I will digest what you said, give it a try and let you know if that worked.
Yes, I do use a date table. That's the table (that's shown in measure) called PBI_FSCAPF. (I didn't name it, someone else did :womanfrustrated:, but that's my date table.)
Rose