Forum Discussion
Can't use SQL TIME as Duration
- Anonymous9 years ago
There is further detail on issues with Duration data type in Power BI on this thread, http://community.powerbi.com/t5/Desktop/Format-the-average-of-a-duration/m-p/95816#M40368
It includes a DAX function to display a decimal version of a Power Query Duration data type in D.HH:MM:SS format. That might be extended for what you need but is restricted for use as text display only, not a numeric measure on charts etc.
- 9 years ago
The solution is that this is not supported and you should vote for a proper feature here: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/8814178-field-of-duration-type
In the meantime, I will add two columns one as text for the table and one as decimal for the graph.
Edit: I just realized the following won't too helpful as the result will be a decimal number anyhow after loading, as you already discovered,
So apologies.
You can transfom time to duration by subtracting #time(0,0,0) from your Duration field (which is formatted as time), like:
= Table.TransformColumns(Typed, {"Duration", each _ - #time(0,0,0), type duration})
where "Typed" is the name of the preceding step.