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
michael_knight
Post Prodigy
Post Prodigy

Convert Duration into DD:HH:MM

Hi,

 

I'm trying to convert a Duration field, display it by DD:HH:MM. Using this article I was able to yield these result

Capture.PNG

 

Which is alright if I want to display it in a table, but I want to display it in a Column Chart. When I try and put the measure in the column chart it automatically going into the Tooltips and I'm unable is usualise it

 

https://www.dropbox.com/s/raye0i6xfvr0h9y/dates.pbix?dl=0

 

Does anyone have any suggestions on how I can visualise this?

 

Cheers,

Mike

7 REPLIES 7
v-xulin-mstf
Community Support
Community Support

Hi @michael_knight,

 

It is not support to put TXET formatted fields or non-aggregated values as values in a bar chart in power bi now.

Maybe you can summit a idea here.

 

Best Regards,

Link

Hi Link,

 

Is there no alternatives options I can have? I have two date columns, surely there must be a way to create a DD:HH measure at least?

 

Cheers

Hi @michael_knight,

 

Sorry, it is a great pity that the bar chart does not support non-aggregated values in text format as value.

Even DD:HH is in text format.

 

Best Regards,

Link

michael_knight
Post Prodigy
Post Prodigy

Hi,

 

Still looking for suggestion if anyone has any!

 

Cheers

amitchandak
Super User
Super User

@michael_knight , In power query you can use duartion

[creationon] - [new_datelastssigned]

 

in DAX

duration = [creationon] - [new_datelastssigned] // but this will give dd hh:mm:ss

 

duration1 = day([duration]) & ":" &  hour([duration]) & ":" &  hour([Minutes])  & ":" &  hour([Second]) 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Managed to get the DAX to work but it still doesn't come up with what I want it to. 

 

I want it to show DD:HH:MM:SS, and this isn't doing it.

Capture.PNG

Format = var dur = Opportunity[new_datelastassigned] - Opportunity[createdon]
var minu = MINUTE(dur)
var sec = SECOND(dur)
return  
day(dur) & ":" &  hour(dur)  & ":" &  hour(minu)  & ":" &  hour(sec) 

Also, for some reason the days always max out at 30, even though the difference could be 60 days for example

Hi,

 

Sorry I didn't make myself clear, I used that formula in Power Query and then used this DAX code to get the outcome

 

CreatedOn to DateLastAssigned 1 = 

//1.878472
VAR Elapsed_Time = SELECTEDVALUE(Sheet1[CreatedOn to DateLastAssigned])


VAR days = INT (Elapsed_Time) //1

// (1.878472 - 1) *24 =21.083328
VAR _hrs = (Elapsed_Time - days) *24

VAR hrs = INT(_hrs) //21

// ROUND( (21.083328 - 21) * 60, 0) = ROUND( 4.99968 , 0) = 5
VAR mins = ROUND ((_hrs - hrs) * 60,0)

RETURN

//Use FORMAT to FORMAT the string to use 2 chars e.g. 03 rather than just 3
days & " d " & FORMAT(hrs,"00") & " h " & FORMAT(mins,"00") & " m "

 

Tried to do what you suggested in DAX and it didn't work 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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