Forum Discussion

ABR002's avatar
ABR002
Helper I
1 year ago
Solved

Time Span between 2 rows with conditions

This honestly caused me a headache even summing it up to where I hope someone else can understand.  I have a table that tracks the logs of a system, there are several tags that occur, some result in...
  • lbendlin's avatar
    1 year ago

    Your sample data doesn't seem to match your explanation.

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WsrAyMVXSUfLPAxKhBUqxOmAhMyAvKDUxpRJF1BLIC84oLVFwyS8HqQdTEDlTQ7CO4pLEohI0GWMg3zG5JLMsFdkwU3OQhtK8vMy8dIS4pZWBAZDnl1+iALMebhRQzhCXA4ByRtgdYGllaIDmP6CQKab/LK2MQMb7p6XBtccCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Time = _t, Tag = _t, #"System Status" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Time", type time}}),
        #"Grouped Rows" = Table.Group(#"Changed Type", {"System Status"}, {{"Time", each List.Min([Time]), type nullable time}},GroupKind.Local)
    in
        #"Grouped Rows"

     

    Use Grouping with GroupKind.Local