Forum Discussion
Convert hour format data to decimal
- Anonymous7 years ago
Hi Pmorg73
I see that the format for time taken as a long date and hence the formula gives different value.
Going through your file, assuming the time is shown in longdate format then I tweeked the formula
Time*24 = 'Table1'[[Time]] Time]*24 - 24By doing so I got the result the same as Time*24 done in excel and portedover.CheersCheenuSing
Yeah i tried that before I posted the query on here, but it does not work correctly. The formatting of the data is the issue I think. That converts it in to completely wrong answers. (see image)
I have uploaded a BI file with just the data inserted. I did add a column in the excel sheet before I brought it in of the Excel *24 answers that we would need to achieve. I then added a column and did the calc as suggested. See the image the numbers are not correct. I assume it is related to the format of the time entry when I bring it from excel to Power BI, as it is showing as a long date format, but in excel it is an hours format. (blue arrow in image)
link to BI file
Link to excel data
Any suggestions greatly appreciated
Hi Pmorg73
I see that the format for time taken as a long date and hence the formula gives different value.
Going through your file, assuming the time is shown in longdate format then I tweeked the formula
- Pmorg737 years agoPost Patron
Does seem to work. Thanks for that. So I understand it what does the -24 do?
Time*24 = 'Table1'[[Time]] Time]*24 - 24
- Anonymous7 years agoNot applicable
Hi Pmorg73 ,
I was checking the values without '-24' . Everything was more by 24. So I decided to substract 24 and check. It worked.
Cheers
CheenuSing