Forum Discussion
Error on calculating average duration days between two dates
- Anonymous4 years ago
Hi Anonymous ,
Since there are "No" values in your Duration column, we could not directly use maths function like average() or averagex():
So I would firstly convert it to Number type by replace the "No" with number 0:
Measure = IFERROR(CONVERT(MAX('Table_1'[Duration]),INTEGER),0)Then calculate the average:
average = AVERAGEX(FILTER('Table_1',[Duration]<>"No"),[Measure])Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Since there are "No" values in your Duration column, we could not directly use maths function like average() or averagex():
So I would firstly convert it to Number type by replace the "No" with number 0:
Measure = IFERROR(CONVERT(MAX('Table_1'[Duration]),INTEGER),0)
Then calculate the average:
average = AVERAGEX(FILTER('Table_1',[Duration]<>"No"),[Measure])
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.