Hi all,
First time I have encountered the problem when I am changing type of data from " time" to text , I am getting decimals.
This is a part of the code regarding this problem :
let
Source = Excel.Workbook(File.Contents(“C:\Users\iwona \Desktop\Temp Agency - PBI .xlsx”), null, true),
Sheet1_Sheet = Source{[Item=“Sheet1”,Kind=“Sheet”]}[Data],
#“Promoted Headers” = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
#“Changed Type” = Table.TransformColumnTypes(#“Promoted Headers”,{{“Depot”, Int64.Type}, {“Operational Date”, type date}, {“Employee”, Int64.Type}, {“Pay Value”, Int64.Type}, {“Designation”, type text}, {“end_time”, type number}, {“start_time”, type number}, {“Worksheet”, type text}, {“Basic Hours”, type number}}),
#“Duplicated Column” = Table.DuplicateColumn(#“Changed Type”, “end_time”, “end_time_asTime”),
#“Changed Type1” = Table.TransformColumnTypes(#“Duplicated Column”,{{“end_time_asTime”, type text}}),
I always do the same steps and have no idea what is the problem here.
What does the error message say?
Also from the image it only seems to happen for whole numbers, can you confirm that? And what time does “1” represent?
Note that the supplied xlsx was slightly different to the data in the pbix.
After applying some brute force with this custom function
.
You can Group and retrieved first StartTime and last EndTime before performing this simple calc. To return the time value that matches your expected output.
I’ve disabled load for my query, just go to the Power Query Editor and enable load to bring the data in. Okay. Note that you’ll have to switch the selected item in the FileLocation parameter.
Hope that helps.
Hi @Iwona, did the response provided by @Melissa help in solving your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query.