Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Cumulative total for previous day

Cumulative total for previous day.   I want a measure that calculates the total amount for previous day based on the last or max date based on a slicer. My code works for the max date but not when ...
  • onurbmiguel_'s avatar
    4 years ago

    Hello FredL

    Try :

     

    Inv Amt PD = 
    // list of dates in a day before 
    var _allDates = DATEADD('Date'[Date],-1,DAY)
    
    // to see LAST date of day before 
    var _lastDate = LASTDATE(_allDates)
    
    return 
    CALCULATE ( '1 Invoice Table'[Invoice Amount], 'Date'[Column]=_lastDate)

     

    Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
    Best Regards
    BC