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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ChloeDL
Frequent Visitor

Cumulative value - show total - expenditures

Good mornign, 

 

We currently have a table showing the cumulative budgets per year but we would like to represent the data in a way that shows the total budget (end result of cumulative) - the yearl expenditures. See table below. 

 

Fiscal Year Budget ExpendituresFree balance 
2022-202320050150
2023-202415050100
2024-20251005050
2025-202650500
2026-2027050-50

 

What formula would help us achieve that?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @ChloeDL ,

 

Here are the steps you can follow:

1. Create calculated column.

 

number =
VALUE(LEFT('Table'[Fiscal Year ],4))
Expenditures =
var _current=
SUMX(

    FILTER(ALL('Table'),'Table'[number]=EARLIER('Table'[number])),[Budget ])
var _next=
SUMX(
    FILTER(ALL('Table'),'Table'[number]=EARLIER('Table'[number])+1),[Budget ])
var _result=
_current - _next
return
IF(
    [number]=MAXX(ALL('Table'),[number]),
    (SUMX(
    FILTER(ALL('Table'),'Table'[number]=EARLIER('Table'[number])-2),[Budget ])
    -
    SUMX(
    FILTER(ALL('Table'),'Table'[number]=EARLIER('Table'[number])-1),[Budget ]))
    -
    _current
,_result)
Free balance =
[Budget ] - [Expenditures]

 

total = 
SUMX(
    ALL('Table'),[Free balance])

 

2. Result:

vyangliumsft_0-1689734067569.png

 

 

Best Regards,

Liu Yang

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

1 REPLY 1
Anonymous
Not applicable

Hi  @ChloeDL ,

 

Here are the steps you can follow:

1. Create calculated column.

 

number =
VALUE(LEFT('Table'[Fiscal Year ],4))
Expenditures =
var _current=
SUMX(

    FILTER(ALL('Table'),'Table'[number]=EARLIER('Table'[number])),[Budget ])
var _next=
SUMX(
    FILTER(ALL('Table'),'Table'[number]=EARLIER('Table'[number])+1),[Budget ])
var _result=
_current - _next
return
IF(
    [number]=MAXX(ALL('Table'),[number]),
    (SUMX(
    FILTER(ALL('Table'),'Table'[number]=EARLIER('Table'[number])-2),[Budget ])
    -
    SUMX(
    FILTER(ALL('Table'),'Table'[number]=EARLIER('Table'[number])-1),[Budget ]))
    -
    _current
,_result)
Free balance =
[Budget ] - [Expenditures]

 

total = 
SUMX(
    ALL('Table'),[Free balance])

 

2. Result:

vyangliumsft_0-1689734067569.png

 

 

Best Regards,

Liu Yang

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

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.