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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mouzzampk
Helper I
Helper I

List time in rows between start and end time

Hi, how can I convert the data so it looks like that. Handling Time is not important and I can remove it if its making its difficult to convert.

 

unnamed.png

 

29/09/2023 15:47 3391 5

29/09/2023 15:48 3391 5

29/09/2023 15:49 3391 5

29/09/2023 15:50 3391 5

29/09/2023 15:51 3391 5

29/09/2023 15:52 3391 5

29/09/2023 15:41 4684 3

29/09/2023 15:42 4684 3

29/09/2023 15:43 4684 3

29/09/2023 15:44 4684 3

 

1 ACCEPTED SOLUTION
m_dekorte
Super User
Super User

Hi @mouzzampk,

 

If you need to fill the gabs between start- and end time you could use the List.Times function

let
    Source = Table.FromRows(
        {
            {#date(2023, 9, 29), #time(15,47,00), 3391, 5},
            {#date(2023, 9, 29), #time(15,41,00), 4684, 3}
        }, type table
        [Date = date, Start Time = time, Officer = text, Handling Time = number]
    ),
    ListTimes = Table.AddColumn( Source, "Time", each 
        List.Times([Start Time], [Handling Time]+1, #duration(0, 0, 1, 0)), type {time}
    ),
    ExpandTimes = Table.ExpandListColumn(ListTimes, "Time")[[Date], [Time], [Officer]]
in 
    ExpandTimes

 

with this result

m_dekorte_0-1698678824265.png

 

I hope this is helpful

View solution in original post

4 REPLIES 4
m_dekorte
Super User
Super User

Hi @mouzzampk,

 

If you need to fill the gabs between start- and end time you could use the List.Times function

let
    Source = Table.FromRows(
        {
            {#date(2023, 9, 29), #time(15,47,00), 3391, 5},
            {#date(2023, 9, 29), #time(15,41,00), 4684, 3}
        }, type table
        [Date = date, Start Time = time, Officer = text, Handling Time = number]
    ),
    ListTimes = Table.AddColumn( Source, "Time", each 
        List.Times([Start Time], [Handling Time]+1, #duration(0, 0, 1, 0)), type {time}
    ),
    ExpandTimes = Table.ExpandListColumn(ListTimes, "Time")[[Date], [Time], [Officer]]
in 
    ExpandTimes

 

with this result

m_dekorte_0-1698678824265.png

 

I hope this is helpful

Thank you 

AlienSx
Super User
Super User

Hi, @mouzzampk select Start Time and End Time. Then unpivot them.

Thanks for the reply but basically I was looking to fill the gaps between two times and m_dekorte solution worked great. 

 

Thanks again

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.