Forum Discussion
Monthly average excludes small volume day
Hi LeoLi ,
Based on your request, 'I would like to calculate the average errors each day in a month without counting those days where the total error numbers are below 10,' since August 29 and August 30 had error counts of 2 and 3, respectively, they are not included in the average calculation. Therefore, it is not possible to achieve the expected results of 5.5 and 4.5. If you wish to obtain 5.5 and 4.5 as results, you will need to forgo the condition of 'calculating average errors each day in a month without counting those days that total error numbers is below 10.'.
The Measer 2 should be:
Measure 2 =
VAR _DAY = CALCULATE(COUNT('Sheet1'[Trade Date]),FILTER(DimDate,DimDate[DayKey] = MAX(Level2[Value])))
VAR _SUM = [Count Error]
var Validdays = FILTER(VALUES('Sheet1'[Trade Date]),CALCULATE(COUNT('Sheet1'[Error Type]))>=0)
VAR _AVERAGE = AVERAGEX(Validdays,[Count Error])
RETURN
SWITCH(MAX(Level2[Value]),"Total", _SUM,"Average", _AVERAGE,_DAY)
Best Regards,
Bof
Hello Bof,
Thank you for spending time reviewing my question. Sorry for any misunderstanding but what i would like to say about the request description is that i don't want to include thtose days with total error numbers are below 10, which means 213 for Aug 29 and 152 for Aug 30. So that both Aug 29 and 30 should be included in average calculation, while Aug 31 should not since the total error number for that day is 1.
Hope explanations above could make more sense.
Thank you.