Forum Discussion

rod_puente's avatar
rod_puente
Helper I
2 years ago
Solved

Help! Accumulated amount

Community

 

Pls your help, I need a funtion with CALCULATE, that allows me to accumulate by product code.

This is an example, dates can be repeated: ...the formula should be like the yellow column.

 

 

Regards

Rodrigo P.

 

  • rod_puente 

    you can create an index column in PQ

     

     

    then use DAX to create a column

     

    Column = sumx(FILTER('Table','Table'[Codigo Producto]=EARLIER('Table'[Codigo Producto])&&'Table'[Index]<=EARLIER('Table'[Index])),'Table'[Cantidad])
     
     
    pls see the attachment below
     

3 Replies

  • rod_puente 

    you can create an index column in PQ

     

     

    then use DAX to create a column

     

    Column = sumx(FILTER('Table','Table'[Codigo Producto]=EARLIER('Table'[Codigo Producto])&&'Table'[Index]<=EARLIER('Table'[Index])),'Table'[Cantidad])
     
     
    pls see the attachment below