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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Kolumam
Post Prodigy
Post Prodigy

Splitting overlapping dates using Power Query

I have the below table:

 

Start Date of ContractEnd Date of ContractContract
1/7/201931/8/2019X
1/9/201931/3/2020X
12/5/202031/12/2021X
1/4/201731/3/2018Y
1/4/201831/3/2020Y
11/5/202031/12/2021Y

 

I want to split the overlapping dates for each contract like below:

 

Start Date of ContractEnd Date of ContractContract
1/7/201931/12/2019X
1/9/201931/12/2019X
1/1/202031/3/2020X
12/5/202031/12/2020X
1/1/202131/12/2021X

 

Similarly for contract Y. Is this possible?

 

@mow700 @Smauro @Mariusz @HotChilli @edhans @mahoneypat 

1 ACCEPTED SOLUTION

Hi 

this is done in my solution here: https://community.powerbi.com/t5/Desktop/Need-urgent-help-DAX-calculation/m-p/1216539#M541668

 

(Assuming there is an error in the first row of the sample you've provided and it ends end of August and not end of year:

Start Date of Contract End Date of Contract Contract
1/7/2019 31/08/2019 X
1/9/2019 31/12/2019 X
1/1/2020 31/3/2020 X
12/5/2020 31/12/2020 X
1/1/2021 31/12/2021 X

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

10 REPLIES 10

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors