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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
RnVssR
Regular Visitor

Format text to time format

Hi,

 I am using the following formula to calculate the duration that operators spent on IT tickets:

-------------------------------------------------------------

TijdBesteed =
VAR TotalTime = IF(ISBLANK(SUMX(RELATEDTABLE(OperationsActivityTimeRegistrations), OperationsActivityTimeRegistrations[timeSpent_inSeconds])), 0, SUMX(RELATEDTABLE((OperationsActivityTimeRegistrations)), OperationsActivityTimeRegistrations[timeSpent_inSeconds]))

VAR Uren = INT(TotalTime / 3600)
VAR Minuten = INT(MOD(TotalTime, 3600) / 60)
RETURN
    FORMAT(Uren, "00") & ":" & FORMAT(Minuten, "00")
-------------------------------------------------------------
 
I get the correct result. But one of my dashboard users, exports the data to excel to do some analytics. He is doing some caclulation on the duration(TijdBesteed) column, but it's failing because it is in text format. When i want to change the format in Power BI to a timevalue, i get the error(translatef from dutch): Cannot convert the value 30:00 of type Text to type Date.

How do i solve this?
1 ACCEPTED SOLUTION

Hi thank you. I have found another solution, where i convert seconds to time duration using the query editor. Found the answer on this page: https://community.fabric.microsoft.com/t5/Desktop/How-to-convert-seconds-to-hh-mm-ss/m-p/310816#M137...

View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

@RnVssR 

currently the output is Text. you need to use date or time function to make the output be datetime type.

TIME function (DAX) - DAX | Microsoft Learn





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi thank you. I have found another solution, where i convert seconds to time duration using the query editor. Found the answer on this page: https://community.fabric.microsoft.com/t5/Desktop/How-to-convert-seconds-to-hh-mm-ss/m-p/310816#M137...

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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