Forum Discussion
Running Total not correct when adding extra field
Anonymous ,
Try this measure:
RunningTotal =
CALCULATE (
SUM ( fact[Quantity] ),
FILTER ( ALL ( fact ), calendar[Datetime] <= MAX ( calendar[Datetime] ) );
VALUES ( fact[ordernumber )
)
I hope this helps!
Mark this as a solution if it answers your queation. Kudos are always appreciated.
Thanks!
- Anonymous5 years agoNot applicable
The measure not working, because the ALL includes the Fact and therefore I cannot filter the calendar. And could you maybe explain why I need tho add the Values part. I never had to use it before to get the correct outcome.
RunningTotal =
CALCULATE (
SUM ( fact[Quantity] ),
FILTER ( ALL ( fact ),calendar[Datetime] <= MAX ( calendar[Datetime] ));
VALUES ( fact[ordernumber )
)- Tanushree_Kapse5 years agoImpactful Individual
Hi Anonymous ,
Sorry for the typo.
Try this:
RunningTotal =
CALCULATE (
SUM ( fact[Quantity] ),
FILTER ( ALL ( calendar), calendar[Datetime] <= MAX ( calendar[Datetime] ) );
VALUES ( fact[ordernumber )
)
Also here, the VALUES() puts the Ordernumber into the filter context of the CALCULATE()-statement. Otherwise you would have running totals on the dates, but it would be the same for all your Ordernumbers.Thanks
- Anonymous5 years agoNot applicable
That is not working unfortunatly..
Even without ordernumber it is not working
When I remove the values part it does, but not with the ordernumber..