Forum Discussion

Giancarlo1977's avatar
Giancarlo1977
Frequent Visitor
2 years ago
Solved

Cumulative subraction in Column

Hi,   I am looking for a formula that should give me the result as per table below in last column "Cumulative remaining stock"   Country serial number Item Number Concatenate QTY Item Numb...
  • barritown's avatar
    2 years ago

    Hi Giancarlo1977,

     

    You could try such a calculated a column:

     

    Here's the code in plain text for convenience:

    Cumulative remaining stock = 
    VAR CurrentSelection = [Concatenate]
    VAR CurrentSN = [serial number]
    VAR Delta = SUMX ( FILTER ( 'Table', [Concatenate] = CurrentSelection && [serial number] <= CurrentSN ), [Qty Item Required for each serial number] )
    RETURN [QTY Item Number in stock] - Delta

     

    Best Regards,

    Alexander

    My YouTube vlog in English

    My YouTube vlog in Russian