Forum Discussion

Lovebo95's avatar
Lovebo95
Icon for Helper I rankHelper I
6 years ago

Cumulative total with Filter, DatesInPeriod, DatesBetween

Hi everyone,

 

I am trying to understand the function for cumulative total, I am using this function :

 

Sales cumulate = calculate(
	SUM(Table[Sales]);
	Filter(ALL(DimDate);
		DimDate[Date]<=MAX(DimDate[Date])))

 

 

I am trying to understand the filter so I tried with datesInPeriod something like :  

 

 

Sales cumulate = calculate(
       SUM(Table[Sales]);
       DATESINPERIOD(DimDate[Date];MAX(DimDate[Date]);-12;MONTH))

 

 

It was working good, I had a cumulative sum, but when I try with datesbetween :

 

 

Sales cumulate = calculate(
  SUM(Table[Sales]);
  DATESBETWEEN(DimDate[Date];MIN(DimDate[Date]);MAX(DimDate[Date])))

 

 

The sum is not cumulative with datesbetween, it's like a sum(Table[Sales]) function.

 

Do you know why ?

 

Thank you ! 🙂

Regards, 

Lovebo