Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How to trasnform time in Duration

Hello everybody,

 

Hope you guys can help a begginer with what could possibly be a stupid question. I have an Excel Spreadsheet for measuring time spent in each activity of a team off people. Time is recorded using a HH:mm format, so a task that takes 10 minutes is recorded as 00:10. The problem is that PowerBI reads that information as 12:10:00 AM, so it interprets it as a "Time" type data and I need to read it as duration so I can make calcualtions and build visuals. 

 

I was able to create a measure that calculates the total of ours, but that only works as tooltips on visuals and tables/matrixes but as values on a pie chart of anything of the sort. 

 

Any help? I appreciate whatever you can shoot at me to help me out. 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Anonymous 

    I not sure why is your 00:10 in excel displayed 12am as hour, but if you would like to take the duration in minute you may create a new column to take the duration. See my test: 

     





    Paul Zheng
    Don't forget to hit THUMBS UP and mark it as a solution if it helps you!

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Create calculated column

     

    Column= Format(Table[Hour-Minute],"HH:MM")

     

    or you can go to modelling tab.

    Change Data type= Time

    and Format=(HH:MM)

     

    Thanks & regards,
    Pravin Wattamwar
    www.linkedin.com/in/pravin-p-wattamwar

    If I resolve your problem Mark it as a solution and give kudos.

  • Anonymous there are many duration functions in Power Query, read here and these can help.

  • Yggdrasill's avatar
    Yggdrasill
    Icon for Responsive Resident rankResponsive Resident

    You need to transform your column

    To do so - Open Power Query editor (Transform data)

    Select the time column. Then select Transform (upper left corner) - > Select the Time Icon and select "Time only"


  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    I not sure why is your 00:10 in excel displayed 12am as hour, but if you would like to take the duration in minute you may create a new column to take the duration. See my test: 

     





    Paul Zheng
    Don't forget to hit THUMBS UP and mark it as a solution if it helps you!