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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
sindhusabbineni
Regular Visitor

Issue with rounding of time to every 6 hours in a day in power bi

I want to group fields as per the datetime which is a field in the table and is in the format (9/27/2019 00:00:00 AM). My requirement is to group fields for every 6 hours, specifically from 12 AM to 6 AM, 6 AM to 12 PM, 12 PM to 6 PM, 6 PM to 12 AM. I am trying to use the below DAX formula.

roundedhour = MROUND ( UserAPI[dy_startTime], TIME ( 4, 0, 0 ) ) + TIME ( 0, 0, 0 )

But, the time is being rounded for 3 AM to 9 AM, 9 AM to 3 PM, 3 PM to 9 PM, 9 PM to 3 AM which is not what i am looking for. Can you please let me know how to get the required time blocks.

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@sindhusabbineni ,

 


@sindhusabbineni wrote:

I want to group fields as per the datetime which is a field in the table and is in the format (9/27/2019 00:00:00 AM). My requirement is to group fields for every 6 hours, specifically from 12 AM to 6 AM, 6 AM to 12 PM, 12 PM to 6 PM, 6 PM to 12 AM. I am trying to use the below DAX formula.

roundedhour = MROUND ( UserAPI[dy_startTime], TIME ( 4, 0, 0 ) ) + TIME ( 0, 0, 0 )

But, the time is being rounded for 3 AM to 9 AM, 9 AM to 3 PM, 3 PM to 9 PM, 9 PM to 3 AM which is not what i am looking for. Can you please let me know how to get the required time blocks.


Could you please share the sample data and clarify more details for further analysis? 

 

Regards,

Jimmy Tao

@v-yuta-msft 

 
TestEnd_TimeTest Endtime2h
11/10/2019 6:52:12AM11/10/2019 6:00AM
11/10/2019 7:12:12AM11/10/2019 8:00AM

Formula for Test Endtime2h = MROUND(JSAutomation_loading_temp[TestEnd_Time], TIME(2,0,0)) + TIME(0,0,0). But I need 6-8 as 6 AM block. Please let me know.

 

 

 

 

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

August Carousel

Fabric Community Update - August 2024

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