Forum Discussion
Running total average in matrix not working properly
- Anonymous1 year ago
Try this:
AVG Cost = VAR MinDate = MIN('ValTB'[Date]) VAR MaxDate = MAX('ValTB'[Date]) RETURN CALCULATE( DIVIDE( SUM(ValTB[Cost]), SUM(ValTB[Quant]), 0), FILTER( ALL(ValTB), ValTB[Date] >= MinDate && ValTB[Date] <= MaxDate ) )When you choose to check data for September, it ignores previous dates and only considers data for September.
If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Hussein_charif
I think your measure does not consider the start date in your date slicer but only the end date. Therfore, you could modify the measure to ignore the date slicer for the start date. try the below measure.
AVG Cost =
VAR MinDate =
CALCULATE(
MIN(ValTB[Date]),
ALL(ValTB))
VAR MaxDate =
MAX(ValTB[Date])
RETURN
CALCULATE(
DIVIDE(
SUM(ValTB[Cost]),
SUM(ValTB[Quant]),0),
FILTER(
ALL(ValTB[Date]),
ValTB[Date] >= MinDate &&
ValTB[Date] <= MaxDate
),
REMOVEFILTERS(ValTB[Date]))
Let me know if it works. Thanks
hi suparnababu8 , this returned the same exact values as my prev measure
- suparnababu81 year agoSuper User
Let me check and get back.
- Hussein_charif1 year agoHelper V
much appreciated🙏