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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors