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
unclejemima
Post Patron
Post Patron

Extract Hour from Transaction time not working, returning always 12:00am

I'm trying to extract the hour from a transaction table called Trandata, what has a column called "EnterTime".  EnterTime is formatted as TIME and format (h:mm tt)

 

I made a new calc column and put the formula

1Hour = hour(Trandata[EnterTime])

but it returns always 12:00:00 AM instead of, say 8am, 4pm, etc.

 

 

Any idea's?

1 ACCEPTED SOLUTION

Hi.  I might be on last months release, but very current.

 

I was able to make it work by making a new column called 1HourTime where I formated the 1Hour column to a TIME value.

 

1HourTime = TIME(Trandata[1Hour],0,0)

Then I could format that as normal time and all is good.  The 1Hour column would only work as a whole number.

 


Weird but works now!

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

Strange. I tried to replicate this but cannot. Even if I change the column from Time to Text, it still works! Are you on March 2018 for Desktop?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi.  I might be on last months release, but very current.

 

I was able to make it work by making a new column called 1HourTime where I formated the 1Hour column to a TIME value.

 

1HourTime = TIME(Trandata[1Hour],0,0)

Then I could format that as normal time and all is good.  The 1Hour column would only work as a whole number.

 


Weird but works now!

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.