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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
srpeters
Helper II
Helper II

Add all values up until a year for all years

Hello,

 

If I have a column in a table for amounts (Table[Amounts]) and another column with the year correlated to those amounts (Table[Year]). Currently if I had a bar graph with the amounts as the Y axis and the years as the X axis, it would show the sum of the amounts that correlate to their years for each year. Is it possible to instead show the sum of all the amounts of all prior years for each year? 

 

For example, if 2001 had 10000.60 as its sum of amounts and 2002 had 5000.00, I would want the year 2002 to be represented by 15000.60 not 5000.00. 

 

Thank you in advance!

2 ACCEPTED SOLUTIONS
audreygerred
Super User
Super User

Hi! Check out this running total article from SQLBI: Computing running totals in DAX - SQLBI

audreygerred_0-1722543856442.png

 





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

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi @srpeters ,
Thanks for @audreygerred reply.
Here are some steps you can try:
Sample data

vheqmsft_0-1722567608985.png

Create a calculate column

Totalization = 
CALCULATE(
    SUM('Table'[Amounts]),
    FILTER(
        'Table',
        'Table'[Year] <= EARLIER('Table'[Year])
    )
)

Final output

vheqmsft_1-1722567667281.png

 

Best regards,
Albert He

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @srpeters ,
Thanks for @audreygerred reply.
Here are some steps you can try:
Sample data

vheqmsft_0-1722567608985.png

Create a calculate column

Totalization = 
CALCULATE(
    SUM('Table'[Amounts]),
    FILTER(
        'Table',
        'Table'[Year] <= EARLIER('Table'[Year])
    )
)

Final output

vheqmsft_1-1722567667281.png

 

Best regards,
Albert He

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

This worked, thank you!

audreygerred
Super User
Super User

Hi! Check out this running total article from SQLBI: Computing running totals in DAX - SQLBI

audreygerred_0-1722543856442.png

 





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

Proud to be a Super User!





Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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