Forum Discussion
cpdanielmc21
6 years agoHelper I
Running Total solution for slicer
Hi community I've been trying to apply solutions proposed in this forum for similar issues to mine, but have not been successful so far. I want to create either a measure or a column that can he...
- 6 years ago
Ok. I played with this some more. Please try this expression. Having account in both the table and the slicer makes this a challenge.
RunningTotal = var thisdate = CALCULATE(MAX(Total[Date]), ALLSELECTED(Total[Account]))return CALCULATE(SUM(Total[Amount]), ALLEXCEPT(Total,Total[Account]), Total[Date] <= thisdate)Regards,
Pat
cpdanielmc21
6 years agoHelper I
Thanks Pat, but still getting same result, 😞
I just returned the original formula for running total and created the new measure, but it gives same numbers
NewMeasure = SUMX(VALUES('Table'[Account]),[RunningTotal])
RunningTotal =
VAR thisdate =
SELECTEDVALUE ( 'Table'[Date])
RETURN
CALCULATE (
SUM ( 'Table'[Amount]),
ALL('Table'),
VALUES('Table'[Account]),
'Table'[Date]<= thisdate
)
mahoneypat
6 years agoMicrosoft Employee
The reason you are seeing the weird #s is because the max date for Account 102 is less than the max for Account 101. You need to get the max date in the selected month in the variable first with this type of change.
RunningTotalAll = var thisdate = CALCULATE(MAX(Total[Date]), ALL(Total), VALUES(Total[Month]))
return CALCULATE(SUM(Total[Amount]), ALL(Total), Total[Date]<= thisdate)
Regards,
Pat