Hi @DavieJoe,
Updated the code, paste this into a new blank query.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("lc9LCoMwEIDhq8isFeZhbHWbUsV16SZ4/2t0DG0cQuoDwr8I+ZhJCEBQA9FaPY+3Zpw0SA1Kw1SRGxDNBSx1AE6I8Q/rvowNk425lb00z9G82qZZ1kbGBba7pMuY13hfXNKyLjJJfzvJbpG1V9n9mPUF1mdsTkzyafJjywc=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Message ID" = _t, Size = _t, Type = _t, #"Location ID" = _t, #"Record Updated" = _t, #"Update Date" = _t]),
ChType = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Message ID", Int64.Type}, {"Size", Int64.Type}, {"Type", type text}, {"Location ID", type text}, {"Record Updated", type datetime}, {"Update Date", type date}}),
Changes = Table.AddColumn(ChType, "Changes", each
let myIndex = if [ID]-2 >=0 then [ID]-2 else 0 in
Text.Combine(
{ (if [Size] <> ChType{myIndex}[Size]? and [Message ID] = ChType{myIndex}[Message ID]? then "Size = " & Text.From( [Size] ) else null),
(if [Type] <> ChType{myIndex}[Type]? and [Message ID] = ChType{myIndex}[Message ID]? then "Type = " & Text.From( [Type] ) else null),
(if [Location ID] <> ChType{myIndex}[Location ID]? and [Message ID] = ChType{myIndex}[Message ID]? then "Type = " & Text.From( [Location ID] ) else null)
}, ", " ), type text
)
in
Changes
.
I hope this is helpful.