Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
SteveAlstead
New Member

Data modelling: find duration of range

Hi all,

 

I have a question about my data. We have sensors in our office. These sensors measure every 10 seconds if there is anyone in a room. These sensors deliver data with for every sensor per 10 seconds a row. 

 

We want to analyse this data which looks like this:

 

Sensor IDDetectionDateTime
100005/1/2023 10:00:10
100010938375/1/2023 10:00:20
10008387735/1/2023 10:00:30
100005/1/2023 10:00:40

 

So in the first column you find the Sensor ID. In the second column you'll find a random number when there is a detection else 0. Last column shows you date/time of detection. 

 

Now I want to transform this table into:

 

Sensor IDFirst detectionLast detection
10005/1/2023 10:00:205/1/2023 10:00:30
And so on  

 

If it's possible to transform the data into this format I can easily analyse the data. 

Any idea's how to fix this?

Sample data: https://we.tl/t-QmD7rei7K8

 

Kind regards,

Steve

2 REPLIES 2
amitchandak
Super User
Super User

@SteveAlstead , Try measures like

First detection = Minx(filter(Table, Table[Detection] <>0) , [DateTime])

 

Last detection = Maxx(filter(Table, Table[Detection] <>0) , [DateTime])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, 


Thanks for your reply! The problem is that there are per sensor per day lot's of detections. See my sample data for an example. So I think it's not that easy using iterators to fix this problem. Or could you maybe show an example how you think to solve this problem?

 

Kind regards,

Steve

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors