HOUR Function (DAX)

How does the HOUR function (DAX) work?

The HOUR function returns the time from 0 (12:00 AM) to 23 (11:00 PM) as a number.

HOUR Formula Syntax

 HOUR (<datetime>) 

How do you use the HOUR function?

The HOUR function takes as argument the time that contains the hour you want to find. You can supply the time by using a date/time function, an expression that returns a datetime, or by typing the value directly in one of the accepted time formats. Times can also be entered as any accepted text representation of a time.

Related Blog Posts


Related Support Forum Posts

Calculating working hours between 2 timestamps
Date time (up to hour) range filter
Time of Day Slicer

Considerations when using the HOUR function

When the datetime argument is a text representation of the date and time, the function uses the locale and date/time settings of the client computer to understand the text value in order to perform the conversion. Most locales use the colon (:) as the time separator and any input text using colons as time separators will parse correctly. Review your locale settings to understand your results.


Related Video Tutorials

EDNA TV-Create Date Table fast
EDNA TV-Averages per Day

Formula examples using the HOUR function

=HOUR("March 3, 2008 3:00 PM")

Related DAX Functions

Date and Time Functions

Related Course Modules



Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.

Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide