Forum Discussion

PhillipB's avatar
PhillipB
Frequent Visitor
3 years ago
Solved

Data with an uncertain start point

I am working with testing data and there is a complication as to when the test is started.  The data is recorded automatically and relates to engine RPM and oil pressure.  The recording starts as soo...
  • jgeddes's avatar
    3 years ago

    In Power Query

    Starting with

    -add an index column starting from 1

    Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type)

    -find the lowest value of the index column where the RPM = 1850

    Table.AddColumn(#"Added Index", "initialZero", each List.Min(Table.SelectRows(#"Added Index", (x)=>x[RPM]=1850)[Index]) )

    -subtract the initialZero column from the Index column

    Table.AddColumn(#"Added Custom", "Relative Time", each [Index] - [initialZero])

    -remove the Index and intialZero columns

    Table.RemoveColumns(#"Added Custom1",{"Index", "initialZero"})

    and you should end up with