Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
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:
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.
Solved! Go to Solution.
I put your question to the test:
First, determine if the data in your database is in time format.
Connect using DirectQuery mode in desktop. And check that the data type is correct.
Create a column or measure.
Column Hour = HOUR('timeTable'[INV_TIME])
Measure Hour = HOUR(SELECTEDVALUE('timeTable'[INV_TIME]))
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I put your question to the test:
First, determine if the data in your database is in time format.
Connect using DirectQuery mode in desktop. And check that the data type is correct.
Create a column or measure.
Column Hour = HOUR('timeTable'[INV_TIME])
Measure Hour = HOUR(SELECTEDVALUE('timeTable'[INV_TIME]))
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 31 | |
| 28 | |
| 24 | |
| 24 | |
| 19 |
| User | Count |
|---|---|
| 44 | |
| 32 | |
| 18 | |
| 17 | |
| 16 |