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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
GL_OSS
New Member

Power Bi Newby - Problem with Time function

Hello!

I'm totally new with Power BI but managed to connect an SQL and an Oracle database with DirectQuery and create a fancy report. But there I some things in Power Bi that I don't understand and I did not find an answer yet. 
One example I hope you guys can help me with:

I wanted to convert Seconds (counted as seconds after midnight) to an actual time. But no function from wich I thought it would work worked. When I try to use the Time function like

 

 

 

 

 

Zeit_letzte_Meldung = Time(0,0,Databasefieldname) 

 

 

 

 

 

 it alway can't display my visual anymore. I also tried to first divide the seconds with 3600 to get the decimal time but I could not format this either.

What am I doing wrong here? Generally because of the different coding languages and the different places you can put the code I find it very hard to find the right answer to a problem so I would be very glad when you can help me!

BR
GL_OSS

5 REPLIES 5
sergej_og
Super User
Super User

I think you have right thoghts about troubleshooting.
Can you provide a snippet of your data? What is your input in your model and what do you expect as result.
Maybe my undestanding would be better and I can try another approach.

GL_OSS
New Member

No - I only got the time in seconds. 

ok, maybe I had have a similar case in the past.
I have a field which is filled with Millisecond (basically it should be a DateTime).
So I converted this number into a "correct" (readable) DateTime.
Like this:

sergej_og_0-1692782717935.png

Is that something similar to your case?
After converting you can extract the "time" part with e.g. RIGHT(your_table[converted_column], 8 )

sergej_og_0-1692783973317.png


Regards

Hmm - not quite sure. When it did not work with the TIME function I did create a custom field called "Decimaltime" (DatabaseFieldWithSecondsAfterMidnight/3600). Tried to Format it and same result. It seems I'm not allowed to do such kinds of transformations with directQuery. Or - what also can be - I do it in a wrong way. Perhaps I have to create more steps or so but all attemps ended in an error and I tried A LOT.

sergej_og
Super User
Super User

Hey @GL_OSS ,
congrats to your achievements as a newby so far.

Hmm, since you have SQL and Oracle DBs in your access...is there one column (DateTime?) in your DB tables which gives you expexted column format?
If yes, you can try extract Time from this field using PQ.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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