Median of a Time Column


Hi, I’m trying to get the Median of a Time Column and coming up empty. I work in Health Care and we are trying to compute the Median Discharge Time for all Discharges that happen before 11am. I know how to use DAX to do the “Before 11” part, but how do I get the Median of a Date?

In Qlikview where I used to do most of my development, Dates are also numbers so it’s really easy to do. However in PBI, I get the error that the MEDIAN function can’t be done for dates.

Any help here would be appreciated!


I think I might have figured it out. Do you see anything wrong with this or is there a better way perhaps?


Var Med = MEDIAN(‘Turn Around Time’[TA_TIME_Hours])

VAR Hours = INT(Med)

VAR Minutes = (RIGHT(Med,2)/ 100) * 60


Hours & “:” & Minutes


Looks optimal to me. Nice one.


@mcnater, this was an interesting one for me coming from a VB/VBA/.NET programming background, where date/times were actually stored in a numeric format and only displayed in date/time format. I can expect with my data to need to calculate metrics involving duration, time to complete, etc.

The following article about the TIME() function confirms in the Remarks section that Excel also stores date/time values as numbers but DAX/Power BI does not: It also indicates you could use the TIME() function to return your median as an actual time value if desired, such as to use as an axis value on a visual.

A very cool issue and very good to know the result that worked for you!