Articles in this section
Category / Section

Calculating the Average Minutes and Hours Between Two Dates in Bold BI

Published:

In Bold BI, you can calculate the average number of minutes and hours between two dates using specific expressions. This can be useful in various scenarios, such as analyzing the average time taken to complete an order or task.

Calculating Average Minutes

To calculate the average number of minutes between two dates, you can use the following expression:

ABS(AVG(Convert(Decimal,DATEDIFF(MINUTE, [OrderDate], [ScanCompleteDate])))/60)*60

This expression calculates the difference in minutes between the ‘OrderDate’ and ‘ScanCompleteDate’, converts it to a decimal, and then calculates the average. The ABS function is used to ensure the result is an absolute value.

image.png

image.png

Calculating Average Hours

Similarly, you can calculate the average number of hours between two dates with a slight modification to the above expression:

ABS(AVG(Convert(Decimal,DATEDIFF(HOUR, [OrderDate], [ScanCompleteDate])))/60)*60

This expression calculates the difference in hours between the ‘OrderDate’ and ‘ScanCompleteDate’, converts it to a decimal, and then calculates the average. Again, the ABS function is used to ensure the result is an absolute value.

Additional References

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
IJ
Written by Israel Jebaraj Chandirakumar
Updated:
Comments (0)
Please  to leave a comment
Access denied
Access denied