Forum Discussion
How to add hours to DateTime data?
- 9 years ago
You can add a duration to a datetime field, e.g. if your fieldname is "DateTime":
[DateTime] + #duration(0,10,0,0))
The arguments of#duration are days, hours, minutes, seconds.
You can add a duration to a datetime field, e.g. if your fieldname is "DateTime":
[DateTime] + #duration(0,10,0,0))
The arguments of#duration are days, hours, minutes, seconds.
I tried this to type the function #duration function but it's not coming up. Power Bi does not recognize it. Do you know why?
- rtrenado9 years agoRegular Visitor
Same here.. that #Duration formula doesn't works
- MarcelBeug9 years ago
Community Champion
#duration is a Power Query (M) function to be used in the Query Editor.
And it is case-sensitive, so #Duration won't work in any case.
- rtrenado9 years agoRegular Visitor
Sorry, i write Duration here, but i tried with duration as follows:
StartDate = (adx_events[adx_releasedate] + #duration(0,10,0,0))
i get this error on powerbi query editor:
The following syntax error occurred during parsing: Invalid token, Line 1, Offset 32, #.