Forum Discussion
Duration wrongly converted to Date-Time type
- 7 years ago
you can convert them within excel to general format and then copy paste them into Power BI
- Anonymous7 years ago
PowerBI does not currently support milliseconds in date time datatype. I solved the problems like follow:
convert the excel doc to general, load it into PowerBI, and multiply the value by 86400 to get the total number of seconds.
Stachu only in the power query you can change the data type to the duration, but in the desktop view, you can't.
According to this link:
"The Data Type drop down in Query Editor has two data types not currently present in Data or Report View: Date/Time/Timezone and Duration. When a column with these data types is loaded into the model and viewed in Data or Report view, a column with a Date/Time/Timezone data type will be converted into a Date/Time, and a column with a Duration data type is converted into a Decimal Number."
and I don't know how we can convert the decimal number back to the duration, outside the power Query.
for the purpose of the calculation you can keep it as a decimal number, and use e.g. FORMAT in DAX to present it in more user friendly manner
the disadvantage is you will need 2 sets of measures (FORMAT turns values to text)