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