How to Add Time in Power BI

Cody Schneider7 min read

Need to calculate an end time based on a start time and a duration in Power BI? It’s a common task for everything from tracking employee shifts to meeting project deadlines, but it’s not always obvious how to do it correctly. This tutorial will walk you through the simplest ways to add hours, minutes, and seconds to your time values using DAX, complete with practical examples to help you master time-based calculations.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Why Calculating with Time Matters

Working with time is fundamental for analyzing business operations. Whether you're in project management, HR, or logistics, chances are you need to calculate durations and deadlines. Here are a few common scenarios where adding time is essential:

  • Project Management: Calculating when a task is due by adding its estimated duration to its start time.
  • Human Resources: Determining shift end times by adding an employee's scheduled hours to their clock-in time.
  • Logistics and Fulfillment: Estimating an arrival time by adding travel duration to a departure time.
  • Customer Support: Calculating Service Level Agreement (SLA) deadlines by adding a response time requirement to when a support ticket was created.

In all these cases, you’re starting with a timestamp and need to add a specific period - hours, minutes, or seconds - to find a future point in time. Let’s see how to make this happen in Power BI.

Understanding Time in Power BI

Before jumping into formulas, it's helpful to understand how Power BI thinks about time and dates. Power BI uses a DateTime data type, which stores both the date and the time together in a single value. Even if your column only displays "8:00 AM," Power BI also has a date part stored behind the scenes.

This is crucial because when you add time that crosses midnight (for example, adding 3 hours to 10:00 PM), the date part correctly rolls over to the next day. This built-in logic makes date and time math much more reliable.

The key to adding time correctly is using DAX functions that are designed to handle this DateTime format. Trying to add a simple number, like [StartTime] + 8, won't add eight hours, it will add eight full days, which is almost certainly not what you are trying to do.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Method 1: Using the TIME Function with Addition (+)

The most direct and flexible way to add a specific amount of time is by using the TIME function. This function constructs a proper time value that Power BI understands can be added to a DateTime value.

The TIME Function Explained

The syntax for the TIME function is straightforward and simple:

TIME(hour, minute, second)
  • hour: A number from 0 to 23 representing the hour.
  • minute: A number from 0 to 59 representing the minute.
  • second: A number from 0 to 59 representing the second.

For example, TIME(2, 30, 0) creates a time value for 2 hours and 30 minutes. Once you have this time value, you can add it directly to an existing DateTime column.

Step-by-Step: Adding a Fixed Amount of Time

Let's say you have a table named SupportTickets with a column called CreationTime, and your support team has an SLA of 4 hours and 15 minutes to respond. Here’s how you can calculate the Deadline.

1. Create a New Calculated Column: First, go to your table in the "Data" view in Power BI. From the "Table tools" ribbon, click "New column."

2. Write the DAX Formula: In the formula bar, you'll create a new column called Deadline. You simply add the time value created by the TIME function to your start time column.

Deadline = SupportTickets[CreationTime] + TIME(4, 15, 0)

3. Review the Result: A new column will appear in your table. If your CreationTime was 8:00 AM, the new Deadline column will show 12:15 PM.

4. Format the New Column: Power BI might auto-format the column as a full date and time. If you only want to see the time, select the new Deadline column, go to the "Column tools" ribbon, and choose your preferred format from the "Format" dropdown (e.g., Time).

Adding a Dynamic Amount of Time from Other Columns

The real power of this method comes from using other columns as inputs for the TIME function. Imagine you have a table of project tasks where each task has a different duration.

Your table, ProjectTasks, might look like this:

  • TaskName: The name of the task.
  • StartTime: The DateTime the task began.
  • DurationHours: An integer column with the estimated hours.
  • DurationMinutes: An integer column with the estimated minutes.

To calculate the EndTime for each task dynamically, you'd create a calculated column with this formula:

EndTime = ProjectTasks[StartTime] + TIME(ProjectTasks[DurationHours], ProjectTasks[DurationMinutes], 0)

This formula pulls the values from the DurationHours and DurationMinutes columns for each row, creates a unique time value for that specific task's duration, and adds it to the StartTime. This makes your report fully dynamic and adaptable to your source data.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Method 2: Using the DATEADD Function

Another powerful DAX function for working with time is DATEADD. While its name suggests it's only for dates, it works perfectly for time intervals like hours, minutes, and seconds. It's especially useful when you need to add a single, clean interval (e.g., add exactly three hours).

The DATEADD Function Explained

The syntax for DATEADD looks like this:

DATEADD(<column>, <number_of_intervals>, <interval>)
  • <column>: The column containing the start date/time (e.g., 'YourTable'[YourColumn]).
  • <number_of_intervals>: The number of intervals you want to add. This can be a positive (for future) or negative (for past) integer.
  • <interval>: The unit of time you want to add. For time calculations, you'll use HOUR, MINUTE, or SECOND.

Examples of Using DATEADD for Time

Let's use our SupportTickets example again. We have a CreationTime column. Here’s how you could add different time durations.

To add 4 hours:

DeadlineHour = DATEADD(SupportTickets[CreationTime], 4, HOUR)

To add 45 minutes:

DeadlineMinute = DATEADD(SupportTickets[CreationTime], 45, MINUTE)

To add 90 seconds:

DeadlineSecond = DATEADD(SupportTickets[CreationTime], 90, SECOND)

You can even nest DATEADD functions if you need to add both hours and minutes, although it can get a bit cumbersome. For example, adding 4 hours and 15 minutes would look like this:

DeadlineCombined = DATEADD(DATEADD(SupportTickets[CreationTime], 4, HOUR), 15, MINUTE)

While this works, the TIME function method is generally cleaner for adding multiple components (hours, minutes, and seconds) at once.

Common Pitfalls and Best Practices

Time calculations can sometimes produce unexpected results. Here are a few tips to ensure your formulas are accurate.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

1. Always Check Your Data Types

The most common error is a data type mismatch. Ensure that the column you are starting with (e.g., [StartTime]) is set to a DateTime or Time data type in Power Query or the "Column tools." Trying to add time to a text column will result in an error.

2. Understand Midnight Crossovers

Power BI’s DateTime data type handles this for you automatically, but it’s good to be aware of what's happening. If you add 4 hours to 10/26/2024 10:00 PM, the result will correctly be 10/27/2024 2:00 AM. The date automatically increments. Just be sure to use a format that displays the date part if it's relevant to your analysis.

3. Use Variables for Complex Formulas

If you're building a more complex calculation, use variables with VAR and RETURN to keep your DAX code clean and readable. This is especially helpful if you need to calculate a duration first before adding it.

For example:

EndTimeComplex = 
VAR StartTimestamp = ProjectTasks[StartTime]
VAR Duration_Hours_Total = ProjectTasks[DurationInDays] * 24 + ProjectTasks[DurationInHours]
RETURN
StartTimestamp + TIME(Duration_Hours_Total, ProjectTasks[DurationInMinutes], 0)

Final Thoughts

Calculating time in Power BI is a common requirement for creating insightful operational dashboards. By using the addition operator (+)" with the TIMEfunction, you can flexibly add both fixed and dynamic durations. For adding simple, single intervals like hours or minutes, theDATEADD` function offers a clear and powerful alternative.

While mastering DAX is invaluable for building custom reports, we know that sometimes you need insights without feeling like you have to be a developer. At Graphed, we created a tool that lets you connect your marketing and sales data sources—like Google Analytics, Shopify, and Salesforce—and build real-time dashboards just by describing what you need in plain English. Instead of wrestling with functions and models, you can ask a question, and we'll instantly generate the chart or report you need, giving you more time to act on the data instead of just organizing it.

Related Articles