I need to display a duration (hh:mm:ss.mmm) in a grid and in a chart.
I have a SQL view where I use a date difference to generate a Duration field converting to Time:
CONVERT(TIME,r.DateUpdated-r.DateRun) as Duration,
The view correctly reports this as a Duration field (hh:mm:ss.mmm):
Then I import the view to Power BI Desktop.
The duration is treated as a Time field and shown as 12:XX:YY AM by default (but the underlying data HH:MMSS.MMM is understood, as you can see from the filter below):
If I transform the column into a Duration, I get ERRORS.
To fix this, I can transform the field in text first and then into duration, and it shows the correct thing on the query editor:
But now if I go to the PowerBi window, I see this as a decimal number:
So in my charts are shown as a decimal point, now I completely lost the concept that the duration was 6 minutes, I only have a 0.00!
This is making me nuts, how can I visualize a SQL field of type TIME in the correct format of HH:MMS.MMM on Power BI?