Forum Discussion
How to dynamically calculate averages for time values?
Hey there,
I am having an issue to dynamically calculate averages for time value, these are my columns:
as I firgured out, there is no way to do it with the duration column, as it allows to perform 'count' and 'count (distinct)'. My idea is to change time period dynamically (e.g. Last Month, Last Week). The problem is there are many duration rows for a single website, that's why I need to calculate an average.
Looking forward to your answers.
Anonymous, convert the duration to seconds to minutes and use avg of that
example
Time in sec = hour([Time])*3600 + minute([Time]) + second ([Time])
also refer
https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-using-dax
https://social.technet.microsoft.com/wiki/contents/articles/33644.powerbi-aggregating-durationtime-in-dax.aspx
https://www.pbiusergroup.com/communities/community-home/digestviewer/viewthread?GroupId=547&MessageKey=814a2cb4-3cca-4cd1-a620-c467adeaaaf6&CommunityKey=b35c8468-2fd8-4e1a-8429-322c39fe7110&tab=digestviewer
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389
1 Reply
- amitchandak
Super User
Anonymous, convert the duration to seconds to minutes and use avg of that
example
Time in sec = hour([Time])*3600 + minute([Time]) + second ([Time])
also refer
https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-using-dax
https://social.technet.microsoft.com/wiki/contents/articles/33644.powerbi-aggregating-durationtime-in-dax.aspx
https://www.pbiusergroup.com/communities/community-home/digestviewer/viewthread?GroupId=547&MessageKey=814a2cb4-3cca-4cd1-a620-c467adeaaaf6&CommunityKey=b35c8468-2fd8-4e1a-8429-322c39fe7110&tab=digestviewer
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389