NOW DAX Function (Date and Time) Volatile

Returns the current date and time in datetime format.

Syntax

NOW ( )

This expression has no parameters.

Return values

Scalar A single datetime value.

Current date and time.

Remarks

The result of the NOW function changes only when the column that contains the formula is refreshed. It is not updated continuously.
The TODAY function returns the same date but is not precise with regard to time; the time returned is always 12:00:00 AM and only the date is updated.

» 3 related functions

Examples

--  TODAY returns today, as a date. NOW also includes the time
--  UTCTODAY and UTCNOW return today using UTC standard.
--  The timezone is the timezone of the server running DAX, your
--  PC when executed in Power BI Desktop.
--
--  The Power BI Service alwyas uses UTC. 
--  Therefore, no daylight saving applies.
--  
--  Keep in mind that DAX.do caches query results, so you will not see
--  an updated result if you try this query without making any change.
EVALUATE
{ 
    ( "TODAY", TODAY () ),
    ( "UTCTODAY", UTCTODAY () ),
    ( "NOW", NOW () ),
    ( "UTC NOW", UTCNOW () )
}
Value1 Value2
TODAY 2021-02-26 00:00:00
UTCTODAY 2021-02-26 00:00:00
NOW 2021-02-26 10:31:35.75
UTC NOW 2021-02-26 10:31:35.75
--  Compute the difference in days and hours between 
--  current time zone and UTC.
--  
--  Keep in mind that DAX.do caches query results, so you will not see
--  an updated result if you try this query without making any change.
EVALUATE
VAR DaysFromUTC = INT ( TODAY () - UTCTODAY () )
VAR HoursFromUTC = ( NOW () - UTCNOW () ) * 24
RETURN
{ 
    ( "Days from UTC: ",  DaysFromUTC  ),
    ( "Hours from UTC: ",  HoursFromUTC)
}

Related functions

Other related functions are:

Last update: Nov 14, 2024   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

Microsoft documentation: https://docs.microsoft.com/en-us/dax/now-function-dax

2018-2024 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Volatile

A volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Contribute

Want to improve the content of NOW? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.