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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
kkiii
New Member

Cumulative Total aggregating prior years

I want to draw a line chart for this, Year in the X axis, Cumulative total in Y axis.

The assumption is that the Cumulative total only starts to count in the year after and the saving is aggregating and repeated each year after

 

For 2019, the toal is 0.

For 2020, the total is 10 from 2019. 

For 2021, the total is 10*2+100=120.

For 2022, the total is 10*3+100*2+1000=1230.

 

YearTime Saving
201910
2020100
20211000

 

Could anyone help?

1 ACCEPTED SOLUTION
barritown
Super User
Super User

Hi @kkiii,

If you can add "2022" to your initial table, the following calculated column will do the calculation:

barritown_0-1704726187399.png

In plain text:

Result = 
VAR CurrentYear = [Year]
VAR tbl = ADDCOLUMNS ( FILTER ( Data, [Year] < CurrentYear ), "Ratio", CurrentYear - [Year] )
RETURN SUMX ( tbl, [Ratio] * [Time Saving] ) + 0

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

View solution in original post

1 REPLY 1
barritown
Super User
Super User

Hi @kkiii,

If you can add "2022" to your initial table, the following calculated column will do the calculation:

barritown_0-1704726187399.png

In plain text:

Result = 
VAR CurrentYear = [Year]
VAR tbl = ADDCOLUMNS ( FILTER ( Data, [Year] < CurrentYear ), "Ratio", CurrentYear - [Year] )
RETURN SUMX ( tbl, [Ratio] * [Time Saving] ) + 0

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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