Forum Discussion
QuasemS
10 years agoFrequent Visitor
Calculating day/time difference
I have two columns, both with dates and times in the same format. I want to create a new column to calculate the days/times differences between the two columns. But when I try to change the data type...
- 10 years ago
You can also add a custom column in Query Editor.
=Duration.ToText([AlarmClearedUTC]-[AlarmSentUTC])
And then in DAX
Column = IF ( LEFT ( Table1[Duration], IFERROR ( SEARCH ( ".", Table1[Duration] ), 1 ) - 1 ) = "", 0, LEFT ( Table1[Duration], IFERROR ( SEARCH ( ".", Table1[Duration] ), 1 ) - 1 ) ) & " DAY " & RIGHT ( Table1[Duration], 8 )Or Duration.ToRecord and expand?
Duration.ToRecord([AlarmClearedUTC]-[AlarmSentUTC])
Greg_Deckler
10 years agoCommunity Champion
Does this help?
Or this?
http://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486