- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Average of first time value per day
Hi all,
I struggling with a formaula to calculate the average start time of surgeries each day.
I have a column "Surgery_Start_DT_TM" (7/11/2019 7:58:00 AM) This column list all surgery start date and time as the title suggest.
I need to find the first time value for each day, then add each first time values for those days and divid by the number of days.
This would indicated the average time our first surgery begun each day. Then as I slice by surgeon, we can see each surgeons results.
I can't seem to pull this one out of my head.
Thanks for any help you can offer.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@tbobolz -
Here is an example table that only contains 9 days (July 1-9 2019). For each day, the hour is set to the same as the day number. So, each day only has one time, and the average time of those is 5AM:
DateTime = var cal = CALENDAR(date(2019,7,1), date(2019,7,9)) var add_DateTime = ADDCOLUMNS(cal, "DateTime", [Date] + (1/24*day([date]))) var add_DateOnly = ADDCOLUMNS(add_DateTime, "DateOnly", DATEVALUE([DateTime])) --Bold part could be a Calculated Column formula var add_TimeOnly = ADDCOLUMNS(add_DateOnly, "TimeOnly", TIMEVALUE([DateTime])) --Bold part could be a Calculated Column formula return add_TimeOnly
Then, the measure groups by day, finds the minimum time for each day, finds the average of the minimums, and formats as time:
Average Start Time = var minTimes = SUMMARIZE('Date',[DateOnly],"Minimum Time", MIN('Date'[TimeOnly])) return FORMAT(AVERAGEX(minTimes, [Minimum Time]), "HH:mm:SS")
Hope this helps,
Nathan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wow, I can't believe how long it ahs been since this posted, I just got back to this thought and below is the solution to what I was originally seeking. Much simplier then I thought, or I'm gettign a little better at DAX!
Thanks again .
This calculation was straight off my date and time columns:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@tbobolz -
Here is an example table that only contains 9 days (July 1-9 2019). For each day, the hour is set to the same as the day number. So, each day only has one time, and the average time of those is 5AM:
DateTime = var cal = CALENDAR(date(2019,7,1), date(2019,7,9)) var add_DateTime = ADDCOLUMNS(cal, "DateTime", [Date] + (1/24*day([date]))) var add_DateOnly = ADDCOLUMNS(add_DateTime, "DateOnly", DATEVALUE([DateTime])) --Bold part could be a Calculated Column formula var add_TimeOnly = ADDCOLUMNS(add_DateOnly, "TimeOnly", TIMEVALUE([DateTime])) --Bold part could be a Calculated Column formula return add_TimeOnly
Then, the measure groups by day, finds the minimum time for each day, finds the average of the minimums, and formats as time:
Average Start Time = var minTimes = SUMMARIZE('Date',[DateOnly],"Minimum Time", MIN('Date'[TimeOnly])) return FORMAT(AVERAGEX(minTimes, [Minimum Time]), "HH:mm:SS")
Hope this helps,
Nathan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wow, I can't believe how long it ahs been since this posted, I just got back to this thought and below is the solution to what I was originally seeking. Much simplier then I thought, or I'm gettign a little better at DAX!
Thanks again .
This calculation was straight off my date and time columns:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for you time Nathan!!
It is much appreciated. This looks perfect! Let me play around with this next week and I'll let you know how it goes. Of course this projects on hold for yet a different fire. LOL!
Terry

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
09-06-2024 04:51 AM | |||
05-03-2024 03:14 AM | |||
03-01-2024 04:58 PM | |||
09-27-2024 04:38 AM | |||
06-02-2023 08:00 AM |
User | Count |
---|---|
135 | |
124 | |
83 | |
61 | |
46 |