Forum Discussion

abssenthil_pbi's avatar
abssenthil_pbi
Frequent Visitor
4 years ago
Solved

Running total by ignoring negative values

Hi All, I am looking for a help where i need to calculate the running total by ignoring the negative values below is the sample where i need to calculate C by adding A and only positive numbers of ...
  • lbendlin's avatar
    lbendlin
    4 years ago

    cumul =
    VAR d =    MAX ( 'Table'[Month] )
    VAR t =
        SUMMARIZE (
            FILTER ( ALLSELECTED ( 'Table' ), [Month] <= ),
            'Table'[Month],
            "a", SUM ( 'Table'[A] ),
            "b", SUM ( 'Table'[B] )
        )
    RETURN    0  + SUMX ( t, [a] + MAX ( 0, [b] )