Forum Discussion
Anonymous
4 years agoNot applicable
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 ...
- 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
onurbmiguel_
Power Participant
4 years agoHello 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
Anonymous
4 years agoNot applicable
Hi to both of you. This definately helped with getting it to work with the date slicer. The only thing now is I want to see the cumulative total from "Previous Day" rather than a single day. As you can see in below total it is only the total for that day. Please let me know if you can assist.
- AllisonKennedy4 years ago
Community Champion
Anonymous If you want cumulative total try:
Cumulative Total Inv Amt PD =_Date = MAX(Date[Date])-1CALCULATE ( [Invoice Amount], FILTER(Date, Date[Date] <= _Date )I am getting a little muddled in what you're trying to do though, so may be worth taking a step back and looking at the basic requirements? Do you have a Running total measure for current day yet? Do you want for all time or just YTD?