Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dommyw277
Helper IV
Helper IV

Meantime to Close Column

Hi, im trying to create a columnn for meantime to close. So if an incident is open, tracking each one on closure time.
I have a created and resolved fields eg createddatetime and resolveddatetime. Any ideas?

2 ACCEPTED SOLUTIONS
PavanLalwani
Resolver II
Resolver II

To calculate the Mean Time to Close (MTTC) in Power BI, you can create a calculated column that calculates the time difference between CreatedDateTime and ResolvedDateTime for each incident. Here’s how you can set it up:

Step 1: Create a New Calculated Column

  1. In your Power BI report, go to the table where your incident data is stored.

  2. Click on Modeling in the toolbar, then select New Column.

  3. Enter the following DAX formula:

    DAX
    Copy code
    MTTC_Hours = IF( ISBLANK([ResolvedDateTime]), BLANK(), DATEDIFF([CreatedDateTime], [ResolvedDateTime], HOUR) )
    • Explanation:
      • DATEDIFF([CreatedDateTime], [ResolvedDateTime], HOUR) calculates the difference in hours between the creation and resolution times.
      • The IF condition checks if the ResolvedDateTime is blank (meaning the incident is still open) and, if so, returns a blank value instead of a time difference.

Step 2: Customize Time Units if Needed

If you’d prefer the time difference in minutes or days, change the last argument in DATEDIFF:

  • For minutes: replace HOUR with MINUTE
  • For days: replace HOUR with DAY

Step 3: Calculate the Average Mean Time to Close (Optional)

If you want an overall average MTTC, create a Measure instead:

  1. Go to Modeling and select New Measure.

  2. Enter this formula:

    DAX
    Copy code
    Average_MTTC_Hours = AVERAGE('YourTable'[MTTC_Hours])

    Replace 'YourTable' with the name of your table. This measure will give you the average time to close across all incidents that have been resolved.

With this setup, you’ll have both a per-incident MTTC and an overall average MTTC for closed incidents.

If this solution brightened your path or made things easier, please consider giving kudos. Your recognition not only uplifts those who helped but inspires others to keep contributing for the good of our community!

View solution in original post

Kedar_Pande
Super User
Super User

@dommyw277 

New Column:

MeanTimeToClose = 
IF(
ISBLANK('YourTable'[ResolvedDatetime]),
BLANK(),
DATEDIFF('YourTable'[CreatedDatetime], 'YourTable'[ResolvedDatetime], MINUTE)
)

You can aggregate this column (e.g., average) in your reports to get the mean time to close incidents.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

View solution in original post

2 REPLIES 2
Kedar_Pande
Super User
Super User

@dommyw277 

New Column:

MeanTimeToClose = 
IF(
ISBLANK('YourTable'[ResolvedDatetime]),
BLANK(),
DATEDIFF('YourTable'[CreatedDatetime], 'YourTable'[ResolvedDatetime], MINUTE)
)

You can aggregate this column (e.g., average) in your reports to get the mean time to close incidents.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

PavanLalwani
Resolver II
Resolver II

To calculate the Mean Time to Close (MTTC) in Power BI, you can create a calculated column that calculates the time difference between CreatedDateTime and ResolvedDateTime for each incident. Here’s how you can set it up:

Step 1: Create a New Calculated Column

  1. In your Power BI report, go to the table where your incident data is stored.

  2. Click on Modeling in the toolbar, then select New Column.

  3. Enter the following DAX formula:

    DAX
    Copy code
    MTTC_Hours = IF( ISBLANK([ResolvedDateTime]), BLANK(), DATEDIFF([CreatedDateTime], [ResolvedDateTime], HOUR) )
    • Explanation:
      • DATEDIFF([CreatedDateTime], [ResolvedDateTime], HOUR) calculates the difference in hours between the creation and resolution times.
      • The IF condition checks if the ResolvedDateTime is blank (meaning the incident is still open) and, if so, returns a blank value instead of a time difference.

Step 2: Customize Time Units if Needed

If you’d prefer the time difference in minutes or days, change the last argument in DATEDIFF:

  • For minutes: replace HOUR with MINUTE
  • For days: replace HOUR with DAY

Step 3: Calculate the Average Mean Time to Close (Optional)

If you want an overall average MTTC, create a Measure instead:

  1. Go to Modeling and select New Measure.

  2. Enter this formula:

    DAX
    Copy code
    Average_MTTC_Hours = AVERAGE('YourTable'[MTTC_Hours])

    Replace 'YourTable' with the name of your table. This measure will give you the average time to close across all incidents that have been resolved.

With this setup, you’ll have both a per-incident MTTC and an overall average MTTC for closed incidents.

If this solution brightened your path or made things easier, please consider giving kudos. Your recognition not only uplifts those who helped but inspires others to keep contributing for the good of our community!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.