We can also use this same basic formula to subtract hours, minutes, and seconds. To see how this works, do the following:
- Create a measure using the following formula:
AddHours 2 =
VAR __Time = MAX([Time])
VAR __Add = -10
RETURN
__Time + __Add/24
- Add this measure to the Table visualization created earlier.
We can also combine these formulas into a single calculation to add hours, minutes, and seconds within a single calculation. To see this in action, do the following:
- Create a measure using the following formula:
AddHoursMinutesSeconds =
VAR __Time = MAX([Time])
VAR __AddHours = 10
VAR __AddMinutes = 10
VAR __AddSeconds = 10
RETURN
__Time + __AddHours/24 + __AddMinutes/24/60 + __AddSeconds/24/60/60
- Add this measure to the Table visualization created earlier.