Forum Discussion
Running Total Help
Hello!
I have a data set that looks like this:
Where
Demand = WeeklyTriggerHrs + TotalHoursCurrent + TotalHrsPastDue
AvgHoursPW = (Sum of run_mch_hrs_per_day)*6
Demand-HoursPW = Demand - AvgHoursPW
I'm having trouble with the RunningTotalDemand-HrsPWHrs. As you can see, it's not creating a running total. Here's the formula I've got so far:
9 Replies
- BeaBFSuper User
MichelleRoberts Hi!
Try with:
RunningTotalDemand-HrsPWHrs =
VAR CurrentDate = MAX('Calendar'[Date])
RETURN
CALCULATE(
SUMX(
FILTER(
ALL('Calendar'),
'Calendar'[Date] <= CurrentDate
),
IF(
[Demand] > 0 || 'Calendar'[Date] = CurrentDate,
[Demand-HoursPW],
0
)
)
)If it's ok please accept my answer as solution, instead, paste me some sample data plis
BBF
- MichelleRobertsRegular Visitor
It's still not calculating correctly. I exported the data to Excel so I could calculate it and compare the two. See below.
- BeaBFSuper User
MichelleRoberts adjusted:
RunningTotalDemand-HrsPWHrs =
VAR CurrentDate = MAX('Calendar'[Date])
RETURN
CALCULATE(
SUMX(
FILTER(
ALL('Calendar'),
'Calendar'[Date] <= CurrentDate
),
IF(
[Demand] > 0 || 'Calendar'[Date] = CurrentDate,
[Demand-HoursPW],
0
)
),
ALLEXCEPT('Calendar', 'Calendar'[Date])
)BBF