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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Split Data rows into multiple rows based on date

Hi All,

 

I have a dataset which has revenue generated by certain clients over their annual cycle since they became a client - for example say 1st April 2021 to 31st March 2022. But could be less or more than a year on some occasions.

I am trying to split revenue for these accounts into calander years and proportion the revenue accordingly. Any idea how to do this in Power Query:

 

So data looks like this:

ClientStart DateEnd DateDuration (Days)Revenue
Client A01/04/202131/03/202236515000
Client B01/01/202131/12/202136520000
Client C01/11/202001/02/202245825000

 

And would like an output like this:

ClientYearDuration (Days)Revenue
Client A202127511301
Client A2022903699
Client B202136520000
Client C2020613330
Client C202136519924
Client C2022321747

 

Cant get my head around how I would do this. Any help would be appreciated.

James 

 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

here is one possible implementation assuming your data is immutable (ie using calculated columns)

 

 

 

Days =
SUMX(
    FILTER( 'Table', 'Table'[Client] = Cross[Client] ),
    COUNTROWS(
        INTERSECT(
            CALENDAR( [Year] & "-01-01", [Year] & "-12-31" ),
            CALENDAR( [Start Date], [End Date] )
        )
    )
)
Revenue =
[Days]
    * SUMX(
        FILTER( 'Table', 'Table'[Client] = Cross[Client] ),
        [Revenue] / COUNTROWS( CALENDAR( [Start Date], [End Date] ) )
    )

 

lbendlin_0-1673664424753.png

 

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors