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:
![](https://static.packt-cdn.com/products/9781839217074/graphics/assets/78f71181-16cb-4135-98a0-68e9c76fb7a0.png)
- Click the Edit button.
- Remove the Changed type step in the Query Settings and then click Close & Apply.