Forum Discussion
nranito
Helper II
8 years agoCalculate Total Previous Day
I have two tables
Calendar, with days
Totals, with Total (let's say sales) per day
Created in table Totals the following measures:
T = SUM(Totals[sales])
PreviousDay = SELECTEDVALUE(Calendar[Day]) -1
TPreviousDay = CALCULATE(Totals[T], FILTER(ALL(Calendar), Calendar[DAY] = [PreviousDay]))
But the TPreviousDay comes always blank...
If I replace [PreviousDay] by a value, it returns the correct value.
Any help?
Fixed it by replacing Calendar[DAY] with SELECTEDVALUE(Calendar[DAY] )
2 Replies
- Floriankx
Solution Sage
You could add a calculated column for previous day:
CALCULATE(Totals[T];FILTER(Calendar;Calendar[Day]+1=EARLIER(Calendar[Day]))
Then you can Sum this Column in a Measure and this should do the job.
- nranito
Helper II
Fixed it by replacing Calendar[DAY] with SELECTEDVALUE(Calendar[DAY] )