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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
calcstuff
Frequent Visitor

Split Start Date and End Date into Multiple Rows

I can have a simple table like this:

 

Start Date    End Date
1/1/20234/30/2023

 

and with the following DAX I can generate a new table with rows between the two dates, on a per day basis:

 

DateSplitTable = 
VAR _StartDate = MIN('YourTable'[Start Date])
VAR _EndDate = MAX('YourTable'[End Date])
VAR _DateDiff = DATEDIFF(_StartDate, _EndDate, DAY)

RETURN
ADDCOLUMNS(
GENERATESERIES(0, _DateDiff, 1),
"SplitDate", _StartDate + [Value]
)

 

and here's the output, just as I expect:

 

Value    SplitDate
01/1/2023
11/2/2023
21/3/2023
......
1184/29/2023
1194/30/2023

 

However, what happens when I add a new column, with multiple people:

 

Person      Start Date    End Date
Bill1/1/20231/5/2023
Melinda2/10/20232/14/2023

 

How can I take my original DAX and modify it to group by person, then split the rows? The output should look like this:

 

Person      SplitDate
Bill1/1/2023
Bill1/2/2023
Bill1/3/2023
Bill1/4/2023
Bill1/5/2023
Melinda2/10/2023
Melinda2/11/2023
Melinda2/12/2023
Melinda2/13/2023
Melinda2/14/2023

 

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @calcstuff 

Here's what I would recommend.

I've tweaked the code to use GENERATE/CALENDAR to expand the list of dates:

DateSplitTable = 
VAR ExpandDates =
    GENERATE (
        YourTable,
        CALENDAR (
            YourTable[Start Date],
            YourTable[End Date]
        )
    )
RETURN
    SELECTCOLUMNS (
        ExpandDates,
        "Person", YourTable[Person],
        "SplitDate", [Date]
    )

 Does this work for you?

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

Hi @calcstuff 

Here's what I would recommend.

I've tweaked the code to use GENERATE/CALENDAR to expand the list of dates:

DateSplitTable = 
VAR ExpandDates =
    GENERATE (
        YourTable,
        CALENDAR (
            YourTable[Start Date],
            YourTable[End Date]
        )
    )
RETURN
    SELECTCOLUMNS (
        ExpandDates,
        "Person", YourTable[Person],
        "SplitDate", [Date]
    )

 Does this work for you?

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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