Forum Discussion
DAX Shift back a datetime variable 70 minutes
- 7 years ago
Hi yios
Datetime type is actually a number where the integer part represents the days and the part behind the decimal separator a fraction of a day. 1/24 would be 1 hour, 1/(24*60) one minute. Based on this you can subtract 70 minutes simply by subtracting 70*/(24*60) from the datetime variable:
NewColumn = Table1[TimeStamp] - 70*/(24*60)
Then convert NewColumn to type DateTime again (the result of the operation will be a decimal number initially)
Hi yios
Datetime type is actually a number where the integer part represents the days and the part behind the decimal separator a fraction of a day. 1/24 would be 1 hour, 1/(24*60) one minute. Based on this you can subtract 70 minutes simply by subtracting 70*/(24*60) from the datetime variable:
NewColumn = Table1[TimeStamp] - 70*/(24*60)
Then convert NewColumn to type DateTime again (the result of the operation will be a decimal number initially)