Forum Discussion

BishwaR's avatar
BishwaR
Helper V
5 years ago
Solved

Cumulative sum

HI I am calculation the cumulative sum of the product sold with the sold date but getting some unwanted result for some dates with multiple sells.

 

Sold Date    Item     No Of Product sold             Running Total       Desired Result

8/10/21        A                           2                              2                           2

8/12/21        B                           1                              3                           3

8/14/21        A                           3                              6                           6

8/15/21        B                           1                                                       7

8/15/21        B                           1                                                       8

 

For the 8/15/21 it is adding the Product Sold (1+1) and adding in the Running Total.

 

Dax I am using is  CALCULATE ( [TOTAL QTY], FILTER(ALL(Sales Table),Sales_date <= MAX(Sales_date))

Note my sales_date is not continueous.

 

Thanks

 

4 Replies