Forum Discussion

kongyuancn's avatar
kongyuancn
Icon for Helper II rankHelper II
5 years ago
Solved

Sum for any period

Hi there,

I have a small table like this:

 

And I want to calculate sum of all previous date. I created a calculated column:

TotalTillThisDate = CALCULATE(SUMX('Table','Table'[Quantity]),FILTER('Table','Table'[Date]<=EARLIER('Table'[Date])))

Then it looks like this:

 

Everything looks fine. But when I want to add a slicer to show a small period, for example, 1/2-1/4, it looks like as following:

The first number 5 is sum of 1/1 and 1/2. This is NOT wha I want (I don't want 1/1 data calculated in this chart). How to make the data strictly limited to the slicer limits? (In this example, I want to get 3, 8, 11 when I set slicer from 1/2 to 1/4)

 

Thanks in advance.


 

 

5 Replies