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.
Another suggestion from my side would to include 2 columns for your durations: one as a duration (which will become a decimal number) and one as a time value, formatted as HH:mm:ss.
Now you can create your visual, using the decimal values as Y-values and add the time values as legend values.
As a result, you will have your time values in the tooltips, formatted as HH:mm:ss.
Drawback is that you need to adjust colors for all time values.
You can hide the legend as such.
Maybe you also want to increase the number of decimals on your Y-axis or otherwise just hide the Y-axis.
This is probably not an ideal solution but at least it's a solution.