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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
2beefd
Frequent Visitor

Date in Time Column 12/30/...

Hi all,

 

I am trying to create a graph using time/date data to show the sum by hour of first responses to tickets. To do this, I removed the date from the time column and rounded to the nearest half hour, accounting for null values, using the following expression: 

 

 

 

 

First Response Time = IF(ISBLANK(Metrics[SLA First Response Date/Time]), MROUND("00:00:00", "00:30:00"), MROUND(FORMAT(Metrics[SLA First Response Date/Time], "hh:mm:ss"), "00:30:00"))

 

 

 

 

This returns a column that only displays time values (even if the data type is set to date/time), but when the data type is set to Time and a graph is made, the X axis formats the time as if it had a date:

 

2beefd_1-1621612790032.png

 

2beefd_0-1621612639993.png

 

My first assumption is that DAX sets the datatype to Time/Date by default but I am unsure how to change it such that only the time values are displayed on the graph. Any suggestions on this would be appriciated

1 ACCEPTED SOLUTION
2beefd
Frequent Visitor

After doing some digging, I was able to determine the cause of this issue. The problem comes from the MROUND function, which when rounding the time would round both up and down to 12:00:00 AM. When rounding up, the time is technically being rounded to 24:00:00, or 12:00:00 AM on 12/31/1899. To solve this issue, I only rounded in the downward direction to the nearest half hour:

 

First Response Time = 
VAR Hour =  HOUR(Metrics[SLA First Response Date/Time])
VAR Minute = MINUTE(Metrics[SLA First Response Date/Time])

RETURN IF(Minute<30,TIME(Hour,0,0),TIME(Hour,30,0))

View solution in original post

3 REPLIES 3
2beefd
Frequent Visitor

After doing some digging, I was able to determine the cause of this issue. The problem comes from the MROUND function, which when rounding the time would round both up and down to 12:00:00 AM. When rounding up, the time is technically being rounded to 24:00:00, or 12:00:00 AM on 12/31/1899. To solve this issue, I only rounded in the downward direction to the nearest half hour:

 

First Response Time = 
VAR Hour =  HOUR(Metrics[SLA First Response Date/Time])
VAR Minute = MINUTE(Metrics[SLA First Response Date/Time])

RETURN IF(Minute<30,TIME(Hour,0,0),TIME(Hour,30,0))
v-luwang-msft
Community Support
Community Support

Hi @2beefd ,

Try creating a calculation column to convert the value to text:

Column = FORMAT('Calendar'[Date] , "hh:nn:ss AM/PM")

 

Wish it is helpful for you!

 

Best Regards

Lucien

Fowmy
Super User
Super User

@2beefd 
If the data type is time and you have applied the formatting as "h:nn:ss AM/PM" then you should only see the time values in the X axis. 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors