Forum Discussion
vrmntmtt
5 years agoFrequent Visitor
Calculating the duration between rows by tagname
Hi, I have a problem, and I could not find it immediatly on this forum. I have a lot of data from a light sensor, and we want to know the % of the time it was giving a signal (value = 1). We...
Anonymous
5 years agoNot applicable
vrmntmtt
This is error is because you compare a integer with a text value, please share a sample in a format we can copy and past, so we can test out to reach your expected outcome.
Paul Zheng _ Community Support Team
vrmntmtt
4 years agoFrequent Visitor
Hi,
Sorry for the late reply. But I solved it a while ago.
I made a calculated column 'stopped at' and it selects the next different date. Except at the end, then Power BI uses Now
I used the following formula:
Stopped_at = IF(CALCULATE(MIN('8xLight_B2'[received_at]), FILTER('8xLight_B2',[received_at] <> EARLIER([received_at]) && [received_at] > EARLIER('8xLight_B2'[received_at])))>0,CALCULATE(MIN('8xLight_B2'[received_at]), FILTER('8xLight_B2',[received_at] <> EARLIER([received_at]) && [received_at] > EARLIER('8xLight_B2'[received_at]))),NOW())
Then I made another calculated column that takes the time difference between the start and end time.