Forum Discussion

kpickle's avatar
kpickle
Frequent Visitor
3 years ago
Solved

Running Total with nested calculation

Hi there,  Is there a way to add a nested calculation within a running total?  Example: When the running total hits 1,000 subtract 900 and continue the running total... Would it better to t...
  • ryan_mayu's avatar
    ryan_mayu
    3 years ago

    kpickle 

    you can update the DAX like below

    Column = 
    VAR _SUM=SUMX(FILTER('Table','Table'[date]<=EARLIER('Table'[date])),'Table'[Daily])
    VAR _reach=int(_SUM/1000)
    VAR _result=_SUM-_reach*900
    return if (_result>1000,_result-900,_result)