Forum Discussion

ValeriaBreve's avatar
ValeriaBreve
Icon for Post Partisan rankPost Partisan
3 years ago
Solved

write a custom function to transform a column

Hello, I have a report with time columns that are expressed in seconds from midnight (so for ex. 48308 corresponds to 1:25 p.m.). As I have a few of those columns, I wanted to create a custom funct...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Is there a Time.FromSeconds function in M? Why not just go

     

    Table.AddColumn(ColumnToConvert, "Time", each Time.From(Value.Divide([ColumnToConvert], 86400)), type time)


    No need for the Mod either.

     

    --Nate