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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
ashrafezz817
Regular Visitor

Converting to Time Error

Hello,

I am currently working in DirectQuery mode with Oracle and encountering an issue while trying to convert a number data type column to time. Initially, when attempting to convert the column directly to a time format, I received the following error:

ORA-01847: day of the month must be between 1 and the last day of the month.

After converting the column to text and trying to extract the hour using the formula:

DAX
Hour = HOUR(TIMEVALUE([inv_time]))

I encountered a new error stating that the value was not a valid month.

This issue does not occur when I switch to Import Mode, but I need to work in DirectQuery mode.

Could you please advise on how to resolve this issue? 

Thank you.

Screenshot 2024-10-23 161428.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ashrafezz817 

 

I put your question to the test:

 

First, determine if the data in your database is in time format.

 

vnuocmsft_0-1729733960949.png

 

Connect using DirectQuery mode in desktop. And check that the data type is correct.

 

vnuocmsft_1-1729734098638.png

 

vnuocmsft_2-1729734191254.png

 

Create a column or measure.

 

 

Column Hour = HOUR('timeTable'[INV_TIME])

 

 

 

Measure Hour = HOUR(SELECTEDVALUE('timeTable'[INV_TIME]))

 

 

Here is the result.

 

vnuocmsft_3-1729734299070.png

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @ashrafezz817 

 

I put your question to the test:

 

First, determine if the data in your database is in time format.

 

vnuocmsft_0-1729733960949.png

 

Connect using DirectQuery mode in desktop. And check that the data type is correct.

 

vnuocmsft_1-1729734098638.png

 

vnuocmsft_2-1729734191254.png

 

Create a column or measure.

 

 

Column Hour = HOUR('timeTable'[INV_TIME])

 

 

 

Measure Hour = HOUR(SELECTEDVALUE('timeTable'[INV_TIME]))

 

 

Here is the result.

 

vnuocmsft_3-1729734299070.png

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.