Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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:
Client | Start Date | End Date | Duration (Days) | Revenue |
Client A | 01/04/2021 | 31/03/2022 | 365 | 15000 |
Client B | 01/01/2021 | 31/12/2021 | 365 | 20000 |
Client C | 01/11/2020 | 01/02/2022 | 458 | 25000 |
And would like an output like this:
Client | Year | Duration (Days) | Revenue |
Client A | 2021 | 275 | 11301 |
Client A | 2022 | 90 | 3699 |
Client B | 2021 | 365 | 20000 |
Client C | 2020 | 61 | 3330 |
Client C | 2021 | 365 | 19924 |
Client C | 2022 | 32 | 1747 |
Cant get my head around how I would do this. Any help would be appreciated.
James
Hi,
You may download my PBI file from here.
Hope this helps.
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] ) )
)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
63 | |
59 | |
56 | |
38 | |
29 |
User | Count |
---|---|
82 | |
62 | |
45 | |
41 | |
40 |