79269897

Date: 2024-12-10 21:50:37
Score: 1
Natty:
Report link

Simple enough,

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7JTM0rUTBU0lEyNDVGkCYWUDJWB67ICChkbGJuCabMTECUkRlItbGxoQGyQpCYkaWpIZgyMwUrNDQEU0ZAhbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Client = _t, Expected = _t, #"Week 1" = _t, #"Week 2" = _t, #"Week 3" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Client", type text}, {"Expected", Int64.Type}, {"Week 1", Int64.Type}, {"Week 2", Int64.Type}, {"Week 3", Int64.Type}}),

    #"Added Column Closest" = Table.AddColumn(#"Changed Type", "Closest", (r) => List.Min(List.Skip(Record.ToList(r), 2), null, each Number.Abs(_-r[Expected])))
in
    #"Added Column Closest"

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: ThxAlot