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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
jeesan1234
Frequent Visitor

Sum of data for prior years in Power BI

I have the following data:

YOAIncurredPaidOutstanding
2002-2-20
2003-21-3
2004-186-20317
2005-80-21-59
2006-60-33-26
2007-540-526-14
2008-22215-237
2009-3494-353
2010-165900-1065
2011111104-508
2012-989-1713-3954
201322212222221
201417852171-386
2015317122-6028
201629205736-2816
2017-12729-3377-9351
201823241572224
20191140312133
20202345949-26915
2021598688409533
202212223233
2023356565656686164
2024566656565656

 

However, I want to combine the data for everything prior 2008 so it looks like:

YOAIncurredPaidOutstanding
2008 and Prior-1092-769-322
2009-3494-353
2010-165900-1065
2011111104-508
2012-989-1713-3954
201322212222221
201417852171-386
2015317122-6028
201629205736-2816
2017-12729-3377-9351
201823241572224
20191140312133
20202345949-26915
2021598688409533
202212223233
2023356565656686164
2024566656565656

 

How do I do this in Power BI? 

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @jeesan1234 - 

 

add a custom column in power query editor as below:

rajendraongole1_1-1728387089825.png

 

 

rajendraongole1_0-1728387060706.png

 

After adding the conditional column, go to the Home tab and click Group By.Select the new column (with "2008 and Prior" and other YOA values).Choose the Sum operation for the Incurred, Paid, and Outstanding columns.

rajendraongole1_2-1728387221781.png

 

final output as below:

 

rajendraongole1_3-1728387318650.png

 

Hope this helps

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

_AAndrade
Super User
Super User

Hi @jeesan1234,

I'm attaching my solution using Power Query.
I hpoe this could help you.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

3 REPLIES 3
_AAndrade
Super User
Super User

Hi @jeesan1234,

I'm attaching my solution using Power Query.
I hpoe this could help you.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




rajendraongole1
Super User
Super User

Hi @jeesan1234 - 

 

add a custom column in power query editor as below:

rajendraongole1_1-1728387089825.png

 

 

rajendraongole1_0-1728387060706.png

 

After adding the conditional column, go to the Home tab and click Group By.Select the new column (with "2008 and Prior" and other YOA values).Choose the Sum operation for the Incurred, Paid, and Outstanding columns.

rajendraongole1_2-1728387221781.png

 

final output as below:

 

rajendraongole1_3-1728387318650.png

 

Hope this helps

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Kedar_Pande
Community Champion
Community Champion

Click on the Modeling tab in the ribbon and select New Table.

CombinedData =
UNION(
SELECTCOLUMNS(
FILTER(YourTable, YourTable[YOA] < 2008),
"YOA", "2008 and Prior",
"Incurred", SUM(YourTable[Incurred]),
"Paid", SUM(YourTable[Paid]),
"Outstanding", SUM(YourTable[Outstanding])
),
SELECTCOLUMNS(
FILTER(YourTable, YourTable[YOA] >= 2008),
"YOA", YourTable[YOA],
"Incurred", YourTable[Incurred],
"Paid", YourTable[Paid],
"Outstanding", YourTable[Outstanding]
)
)

If this helped, a Kudos 👍 or Solution mark would be great!
Cheers,
Kedar Pande
www.linkedin.com/in/kedar-pande

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.