While the DAX DATEDIFF function supports hours, minutes, and seconds for finding the number of hours, minutes, and seconds between two DAX date/time values, the DAX DATEADD function only supports year, quarter month, and day. This recipe demonstrates how to add and subtract hours, minutes, and seconds to and from a DAX time value.
Adding and subtracting time
Getting ready
To prepare for this recipe, do the following:
- Create a table called R04_Table using the following formula:
R04_Table =
VAR __Hours =
SELECTCOLUMNS(
GENERATESERIES(1 , 12 , 1),
"Hour",
[Value] & ":00:00 "
)
VAR __Period =
SELECTCOLUMNS(
...