Forum Discussion

amcneil32's avatar
amcneil32
Frequent Visitor
4 years ago
Solved

use column name in custom column logic

I need to populate an hour column with a zero when an employee is clocked in but the count is blank. So the 12:00 and 15:00 hours need to be populated with a zero on its row.     ID Kronos Clo...
  • v-henryk-mstf's avatar
    4 years ago

    Hi amcneil32 ,

     

    For such reporting errors, you can use Date.ToText() and Number.ToText() to convert public notices.

    just like below:

     

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtI10TUyUNJRMlSKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Value1 = _t, Value2 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Value1", type date}, {"Value2", Int64.Type}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Date.ToText([Value1])&"-"&Number.ToText([Value2]))
    in
        #"Added Custom"


    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.