Forum Discussion
Applying filters to running total?
- 10 years ago
Hi, Anonymous
You want to make the cumulativeHours re-calculate based on the selected filters, right? If so, please create a measure to calculate running total rather than calculated column.
The DAX formula should be like:
MeasureRunningTotal =
CALCULATE(
SUM(Running[TotalDay]),
FILTER(ALLSELECTED(Running),
Running[WeekName]<=MAX(Running[WeekName])
))Thanks,
Yuliana Gu
Hi, Anonymous
You want to make the cumulativeHours re-calculate based on the selected filters, right? If so, please create a measure to calculate running total rather than calculated column.
The DAX formula should be like:
MeasureRunningTotal =
CALCULATE(
SUM(Running[TotalDay]),
FILTER(ALLSELECTED(Running),
Running[WeekName]<=MAX(Running[WeekName])
))
Thanks,
Yuliana Gu
- Anonymous8 years agoNot applicable
I tried the formula but it keep repeating the first number after that. It has 2 slicers, shop and date. Users select a shop and a date range. The running total is on the number of days machines are running during the selected date range for the selected shop.
Shop A has only 5 machines. But the running total ran past the maximum of 5 for Shop A. I think that's because other shops have more machines. One of the shop have 12 machines.
# of Machine # of Day Running Total Desired Result 0 2 2 2 1 6 8 8 2 4 12 12 3 6 18 18 4 6 24 24 5 5 29 29 6 2 7 2 8 2 9 2 10 2 11 2 12 2 RunningTotal = Calculate (SUM(Machine[MachineCount]), FILTER(ALL(Machine[NumberOfMachine], Machine[Shop]),
(Machine[NumberOfMachine] <= max(Machine[NumberOfMachine]) )))
- Anonymous4 years agoNot applicable
Hey why doesn't this work for a calculated column? Is it that a calculated column doesn't re-evaluate inside a visual, so ignores any filter context?