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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
timetothink
New Member

Splitting row in multiple rows by date range

Hi BI community,

 

I am looking for a solution with row data I have, which I need to be split up in mutiple rows by a date range. 

I am getting a start and end date with a monthly value in one row from a system.

I want to get that split up in one row per month, so that I can work with those values in my reports.

 

Any ideas how this could be solved? Can I somehow generate a query that splits up the rows like shown below?

 

I appreciate any help that points me to a solution.

 

The source table looks something like that:

timetothink_0-1686820728667.png

 

The outcome should look like this:

timetothink_1-1686820754418.png

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

https://1drv.ms/u/s!AiUZ0Ws7G26RiGuphOTM9phaNVYh?e=TSmIVh

List.Generate(
    ()=>[Start Date],(x)=>x<=[End Date],(x)=>Date.EndOfMonth( Date.AddMonths(x,1))
     )

Screen Capture #1251.pngScreen Capture #1252.png

View solution in original post

2 REPLIES 2
timetothink
New Member

Thank you for the quick response. Exactly what I needed.

Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

https://1drv.ms/u/s!AiUZ0Ws7G26RiGuphOTM9phaNVYh?e=TSmIVh

List.Generate(
    ()=>[Start Date],(x)=>x<=[End Date],(x)=>Date.EndOfMonth( Date.AddMonths(x,1))
     )

Screen Capture #1251.pngScreen Capture #1252.png

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors