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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dax help for Timestamp format

Hi,

 

Can any one please help me to format below Total Duration Org as below expected format 

 

paw2_1-1676277742209.png

 

Expected total duration

694     0 Days 00:01:00

694     7 Days  00:07:08

 

I have tried like this but its not working

 

Column =
IF (
    LEFT ( 'Table1'[Total Duration Org], IFERROR ( SEARCH ( ".",'Table1'[Total Duration Org]), 1 ) - 1 )
        = "",
    0,
    LEFT ('Table1'[Total Duration org], IFERROR ( SEARCH ( ".", 'Table1'[Total Duration Org] ), 1 ) - 1 )
)
    & " DAY "
    & right(left ( 'Table1'[Total Duration org],11 ),8)

 

 

2 REPLIES 2
Anonymous
Not applicable

@jaweher899 Thanks for your reply. I am getting below error.

 

paw2_0-1676280450037.png

Actually my duration is in text format.

Duration.ToText([Complete]-[Started])

jaweher899
Impactful Individual
Impactful Individual

please try

 

Column =
VAR Days = INT( 'Table1'[Total Duration Org] / 86400 )
VAR Hours = INT( ( 'Table1'[Total Duration Org] - ( Days * 86400 ) ) / 3600 )
VAR Minutes = INT( ( 'Table1'[Total Duration Org] - ( Days * 86400 ) - ( Hours * 3600 ) ) / 60 )
VAR Seconds = MOD( 'Table1'[Total Duration Org], 60 )
RETURN
Days & " Days " &
FORMAT( Hours, "00" ) & ":" &
FORMAT( Minutes, "00" ) & ":" &
FORMAT( Seconds, "00" )

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.