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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to convert the hh:mm:ss format into groups of time period like (5, 10, 30 minutes)?

I am facing an issue of converting the date given in hh:mm:ss format (timestamps) into group of different intervals.

The time data is in the given format.

 

3:12:11 PM value=46

3:12:12 PM value=47

3:12:13 PM value=48

.

.

3:17:00 PM value=55

I want to group the given time instances into 5, 10, 30 minutes periods and find the average of the corresponding time period.

 

output

3:12:00 to 3:17:00 value= average of all the values within that time period.

1 ACCEPTED SOLUTION
Thim
Resolver V
Resolver V

This should do the trick.

Time Grouped = TIME(HOUR(DateTimeTable[Time]);MINUTE(MROUND(DateTimeTable[Time]+1/24/60*3;1/24/60*5));00)
This part "1/24/60*5" is what decides the interval. in this case as it is *5 it is set for a 5 minute interval. change this number, if you want a different interval, or just make a column for each interval you want.
 
This part "1/24/60*3" is to make sure the original time gets in the right group. Just play around with it a bit, and see what fits you best. 🙂
 

Grouped Minutes.PNG

 

Hope this will help.

 

View solution in original post

1 REPLY 1
Thim
Resolver V
Resolver V

This should do the trick.

Time Grouped = TIME(HOUR(DateTimeTable[Time]);MINUTE(MROUND(DateTimeTable[Time]+1/24/60*3;1/24/60*5));00)
This part "1/24/60*5" is what decides the interval. in this case as it is *5 it is set for a 5 minute interval. change this number, if you want a different interval, or just make a column for each interval you want.
 
This part "1/24/60*3" is to make sure the original time gets in the right group. Just play around with it a bit, and see what fits you best. 🙂
 

Grouped Minutes.PNG

 

Hope this will help.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.