Excel – Representing time as a duration in Microsoft Power BI

microsoft excelmicrosoft-powerbitime

I have an Excel spreadsheet containing video statistics. One of those statistics is the length of the video as a duration. When I import this data into Microsoft Power BI, it can be represented as either a time of day (i.e. in 24-hr format or 12-hr with AM or PM) or as a floating point number.

Is there a way to represent this information, either in the Excel file or using some feature of Microsoft Power BI that will show me this value as a duration rather than as a time of day or floating point number?

Best Answer

I would import it as a time of day and then add a calculated column using datediff eg

Video Duration (seconds) = DATEDIFF( DATE( 1899 , 12, 30 ) , [duration] , SECOND )

Power BI uses that wacky date when you load Excel duration data.

Related Question