Forum Discussion

gvlado's avatar
gvlado
Advocate III
2 years ago
Solved

Running totals backwards

Dear community friends  I am curious about how to make measure for running totals backwards - from today back into the past. I have Today inventory, at the end of the day (900), Also have income e...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi gvlado ,

    As Nithinr said, it is possible to do what you need to do based on this DAX code, here are my thoughts and additions.

    First create a table.

    A slight change to Nithinr's DAX code will give you the results you need.

    MEASURE =
    VAR _A =
        CALCULATE (
            SUM ( 'Table'[IN-OUT] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Date] >= MIN ( 'Table'[Date] ) )
        )
    VAR _AA = _A + 900
    RETURN
        _AA

     

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • gvlado's avatar
    gvlado
    2 years ago
    Small correction 900 -> 1000
    And types of columns must be defined
    ---- BOMeasure----------
    Measure
    =
    VAR _A = CALCULATE(
        SUM('Table'[IN-OUT]),
        FILTER(
            ALL('Table'),
            'Table'[Date] >= MIN('Table'[Date])
        )
    )
    VAR _AA = _A + 1000
    RETURN
    _AA
    --- EOMEasure---