Forum Discussion

qwertzuiop's avatar
qwertzuiop
Icon for Advocate III rankAdvocate III
5 years ago
Solved

Sales cumulated by date (Calculated Column)

Hello dear Power-BI-Community

 

Following Problem to solve:

Let's assume the table below as example with the following attributes (date, product, sales)

Needed is the column "sales cummulated" based on product and date as calculated column in Power BI.

 

DateProductSalesSales (cummulated)
01.01.2021A2020
01.02.2021A1030
01.03.2021A5080
A
01.01.2021B55
01.02.2021B2025
01.03.2021B1540
B 
01.01.2021C6060
01.02.2021C2080
01.03.2021C30110
C

 

Any ideas how to achieve?

 

Thank you very much for your contribution.

 

Cheers

qwertzuiop 😊

1 Reply

  • themistoklis's avatar
    themistoklis
    Icon for Community Champion rankCommunity Champion

    Hello qwertzuiop 

     

    Try the following formula:

    Cumulative_Sales =
    CALCULATE (
    SUM ( Sheet1[Sales] ),
    FILTER( ALLEXCEPT( Sheet1,Sheet1[Product] ),
    Sheet1[Date] <= MAX( Sheet1[Date] ))
    )
     
    File attached: