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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
kenwilsonii
Frequent Visitor

Duration Data type shows as decimal, need HH:MM:SS

I used the Duration.FromText to convert a "HH:MM:SS" format for a new columnt from a  text field to Duration data type. The Steps are bit odd though as using Duration.FromText does not automatically change the data type to Duration. I had to add another step to do so. 

Once it was a duration data type it sums properly but is in a decimal format in the Matrix visual.

I need it to be in HH:MM:SS format like it shows on the transform page.

How do I do that? 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @kenwilsonii ,

 

That behavior is expected. Although might have been set as type duration in Power Query they are shown as number when loaded to the model and also when aggregated in a visual. As a workaround, create a measure then format that measure to HH:MM:SS. If that still doesn't work, you can use FORMAT to convert it to text - that would be FORMAT ([Measure], "HH:MM:SS")










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

7 REPLIES 7
kenwilsonii
Frequent Visitor

so this , does work.

 

"As a workaround, create a measure then format that measure to HH:MM:SS."

 

A little annoying though, having to create 2 new measures to get it in a particular format

Test1 = AVERAGE(Call_Center_Data[Talk Duration (AVG)])
Test2 = FORMAT([Test1],"HH:MM:SS")

 

danextian
Super User
Super User

Hi @kenwilsonii ,

 

That behavior is expected. Although might have been set as type duration in Power Query they are shown as number when loaded to the model and also when aggregated in a visual. As a workaround, create a measure then format that measure to HH:MM:SS. If that still doesn't work, you can use FORMAT to convert it to text - that would be FORMAT ([Measure], "HH:MM:SS")










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
kenwilsonii
Frequent Visitor

utilized a Kaggle dataset

Call Center Data | Kaggle

kenwilsonii
Frequent Visitor

 

 

Left screen grab is the data in a matrix visual and the right one is from the Transform/Data Modeling view.

As you can see in the data modeling view it shows as HH:MM:SS, but in the matrix view it is representated as a decimal. I need the view in the matrix visual to be HH:MM:SS

 

Data_Duration_Matrix_View.jpgData_Duration_Model_View.jpg

@kenwilsonii 

Please, know that you have plot column as summarize column. So please plot as a don't summarize so i think you get right output.

 

Thankyou.

 

@kenwilsonii if above solution not work

So create measure :

HMS = format( table[Answer Speed (AVG)] ) ,"HH:MM:SS")

 

Thankyou.

Mahesh0016
Super User
Super User

@kenwilsonii Please Share Your Dummy Data for better Understanding.THANK YOU!!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.