Forum Discussion
Time format export data from hours to decimal
- 6 years ago
In query editor. Select the column and split it by deliminator
You get two columns. 1 is hours, 1 is mins
New column = hours + (mins/60) = decimal number and works with values over 24 hours.
KISS
See if this helps. You should be able to determine the format of your column by counting the number of colons.
https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486
- Pmorg736 years agoPost Patron
now I am compleley lost......
where do I put ? I see nowehere to do this
Duration.TotalHours( Duration.From( [Time Column] ) )
- Pmorg736 years agoPost Patron
last one for a Sunday. Its time to stop haha
two images attached. I interogated the csv file for one specific case. Where ever my entry is greater than 24 hours it is completely and utterly wrong. In query editor I changed the format to duration. That is all I did as I dont follow your other comments and how to apply the DAX line you stated. (???)
- Pmorg736 years agoPost Patron
I had interogated my csv file. My issue is I have two different formats in my output. Once the output value is large than 24 hours it get confused. So my issue is how todeal with two different formats that are time based?
- Greg_Deckler6 years agoCommunity Champion
OK, so the basic problem is that you have a column with different formats that you need to handle different ways. So, you need to identify which format each row is in so that you can later handle it differently. So, I would suggest adding these two columns to your Power Query:
ReplaceColons =Text.Replace([Duration],":","") NumberOfColons =Text.Length([Duration]) - Text.Length([ReplaceColons])Here Duration is your column with your Duration. Again, this is Power Query code. So, now you have your identifier.
- Pmorg736 years agoPost Patron
Just as I am about to try this. What format should I leave the [duration] column in?