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

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

Reply
Vatz8
Helper I
Helper I

Split Datetime range columns into multiple rows for each day.

Hi,

I want to split the datetime columns range into multiple rows as shown below.

 

ID|     punch_Start                     | punch_End
--------------------------------------------
A | 2019-03-04 23:18:00| 2019-03-04 23:21:00
--------------------------------------------
A | 2019-03-04 23:45:00| 2019-03-05 00:15:00
--------------------------------------------

 

Required Output-

ID|       punch_Start                   | punch_End
--------------------------------------------
A | 2019-03-04 23:18:00| 2019-03-04 23:21:00
--------------------------------------------
A | 2019-03-04 23:45:00| 2019-03-04 23:59:00
--------------------------------------------
A | 2019-03-04 23:59:00| 2019-03-05 00:00:00
--------------------------------------------
A | 2019-03-05 00:00:00| 2019-03-05 00:15:14

 

Please let me know how can I achieve this.

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Vatz8 
Please refer to attached sample file with the proposed solution

1.png

Table 2 = 
SELECTCOLUMNS ( 
    GENERATE ( 
        'Table',
        CALENDAR ( 'Table'[punch_Start], 'Table'[punch_End] )
    ),
    "ID", [ID],
    "Punch_Start", MAX ( [punch_Start], [Date] ),
    "Punch_End", MIN ( [punch_End], [Date] + TIME ( 23, 59, 0 ) )
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @Vatz8 
Please refer to attached sample file with the proposed solution

1.png

Table 2 = 
SELECTCOLUMNS ( 
    GENERATE ( 
        'Table',
        CALENDAR ( 'Table'[punch_Start], 'Table'[punch_End] )
    ),
    "ID", [ID],
    "Punch_Start", MAX ( [punch_Start], [Date] ),
    "Punch_End", MIN ( [punch_End], [Date] + TIME ( 23, 59, 0 ) )
)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.