Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Previous Value by Device & Time

Hello Everybody, i've spent the whole afternoon with this dataset:   mts DeviceID cOut 19/10/2020 00:00 A 16.4 19/10/2020 00:05 A 16.4 19/10/2020 00:10 A 16.4 19/10/2020 00:...
  • amitchandak's avatar
    5 years ago

    Anonymous , not sure how got this avg of 20,

     

    Try a new column

    calculate(lastnonblankvalue([mtsHour],max(Average of cOut)),filter(table, [Device] = earlier([Device]) && [mtsHour] <earlier([mtsHour])))

     

    or new measure

    calculate(lastnonblankvalue([mtsHour],max(Average of cOut)),filter(allselected(table), [Device] = max([Device]) && [mtsHour] <max([mtsHour])))