cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gmiro
Regular Visitor

Connecting time slots with time stamp data

Hi!
I'm new to the forum, and I'd like to get any help regarding this issue. I have two datasets connected by time. One of them is a time slot with a status for each of them:

 

Category
EventInitial timeEnd timeDuration
ConditionA11/11/2020 00:00:0011/11/2020 01:49:2101:49:21
ConditionB11/11/2020 01:49:2111/11/2020 01:51:2900:02:08
ConditionA11/11/2020 01:51:2911/11/2020 02:14:4100:23:12
ConditionB11/11/2020 02:14:4111/11/2020 02:14:5600:00:15

 

The second table is a timestamp typical table for time-based data:

DateData AData B
11/11/2020 0:00:002535
11/11/2020 0:10:004520
11/11/2020 0:20:002025
11/11/2020 0:30:003230
11/11/2020 0:40:001245
11/11/2020 0:50:0045210
11/11/2020 1:00:0050220
11/11/2020 1:10:00241235

 

How I can connect each row of the second table with the appropriate data from the 1st table?

Any help would be appreciated. Thanks!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@gmiro , You can get data from first table into second table like

 

maxx(filter(first, second[Date]>= first[Initial time] && second[Date]<= first[End time]), first[Duration])

 

also refer the way to get data from one table to another - https://www.youtube.com/watch?v=czNHt7UXIe8

 

 



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@gmiro , You can get data from first table into second table like

 

maxx(filter(first, second[Date]>= first[Initial time] && second[Date]<= first[End time]), first[Duration])

 

also refer the way to get data from one table to another - https://www.youtube.com/watch?v=czNHt7UXIe8

 

 



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 25

Ted's Dev Camp - August 25, 2022

Watch Session 25 of Ted's Dev Camp.

Top Solution Authors