Forum Discussion
Anonymous
4 years agoNot applicable
Average Measure with filter
Hi, I want to calculate the average days it take to complete an order with product type 'Computer'. How can I calculate that in a measure? This is a sample of my data: OrderID OrderDate ...
- 4 years ago
Anonymous
you can create a column and measure
days = DATEDIFF('Table'[OrderDate ],'Table'[OrderCompleteDate ],DAY) Measure = AVERAGEX(FILTER('Table','Table'[Product ]="Computer"),'Table'[days])or you can create a measure directly.
Measure 2 = VAR tbl=ADDCOLUMNS(FILTER('Table','Table'[Product ]="Computer"),"day2",DATEDIFF('Table'[OrderDate ],'Table'[OrderCompleteDate ],DAY)) return AVERAGEX(tbl,[day2])pls see the attachment below.
Anonymous
4 years agoNot applicable
ryan_mayu Thanks, question: in the second measure, why do you define "day2"?
ryan_mayu
4 years agoSuper User
Anonymous
like manikumar34 mentioned, just want to differerntiate from the day column in the first solution.