Unlike Power Query, DAX has no base data type for duration in the form of HH:mm:ss. However, there are many systems that store durations in the format HH:mm:ss (hours, minutes, and seconds) or d.HH:mm:ss (days, hours, minutes, and seconds). This recipe demonstrates how to convert a duration in the form of HH:mm:ss into the number of seconds using DAX.
Converting duration into seconds
Getting ready
To prepare for this recipe, do the following:
- Open Power BI Desktop and use an Enter Data query to create a table called R10_Table with the following data but do not click the Load button:
- Click the Edit button.
- Remove the Changed type step in the Query Settings and then click Close & Apply.