Forum Discussion

azakir's avatar
azakir
Resolver I
4 years ago
Solved

Time keeps changing to datetime in Power Query

Hi Guys.  Got a weird one here. We have an excel file on web which we ingest to Power BI. I did a report which was working fine till past few days. Apparently there is a "Time at Site" column in exc...
  • v-jingzhang's avatar
    4 years ago

    Hi azakir 

     

    It seems Power BI will detect the data types in Excel and import data with these data types directly. To get just time values, select this column, select Transform > Time > Time Only

     

    Apply this change to data model. Then in Power BI Desktop, change the format of this column to "hh:nn:ss". 

     

    Date and Time in Excel are stored as numbers. This enables a user to use these dates and time in calculations. So another workaround is to change this column's number format to General or Number in Excel first. This will convert these time values into decimal numbers. Then import data into Power BI. In Power Query Editor, change this column's data type to Time. This will convert them back to Time values. 

     

    Hope this helps. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.