Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Can't use SQL TIME as Duration

$
0
0

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:MMSmiley FrustratedSS.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:MMSmiley FrustratedS.MMM on Power BI?

 

 


Viewing all articles
Browse latest Browse all 213819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>