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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ChloeDL
Frequent Visitor

Formula Help!!

Basically, we have this huge dataset with individual line items for every transaction which includes prj info, budget, fiscal year etc. First, we need a formula to get the cumulative spent by budget by year. Second we need a formula that will subtract the actuals from given total budget amount again by budget and fiscal. Thing is the dataset doesn’t have budget amounts. It has what was allocated and what was spent where we need to show when the “bucket” will run out of money. Here's an example of what we're trying to accoplish. 

 

 2018-2019  2019-2020  2020-2021  
 ActualsCumul. LeftActualCumul.LeftActualCumul.Left

B2018

6 10-6=461210-12=-(2)61810-18=-(8)
X1 10-1=91110-2=813

10-3=7

Y2 10-2=82410-4=62610-6=4
Z3 10-3=73610-6=43910-9=1
B20216 20-6=1461220-12=861820-18=2
X1 20-1=191220-2=181320-3=17
Y2 20-2=182420-4=162620-6=14
Z3 20-3=173620-6=143920-9=11

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  , @ChloeDL 

 

Is this result you want to achieve?

vmengzhumsft_0-1661240916692.png

you just need to create two new columns:

 

 

sum = CALCULATE(SUM('Table'[actuals]),FILTER(ALL('Table'),'Table'[actuals]<=EARLIER('Table'[actuals])))

 

 

value = 'Table'[TBbudget]-'Table'[sum]

 

This is my testing PBIX  file.

 

Best regards,

Community Support Team Selina zhu

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

5 REPLIES 5
Anonymous
Not applicable

Hi  , @ChloeDL 

 

Is this result you want to achieve?

vmengzhumsft_0-1661240916692.png

you just need to create two new columns:

 

 

sum = CALCULATE(SUM('Table'[actuals]),FILTER(ALL('Table'),'Table'[actuals]<=EARLIER('Table'[actuals])))

 

 

value = 'Table'[TBbudget]-'Table'[sum]

 

This is my testing PBIX  file.

 

Best regards,

Community Support Team Selina zhu

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

daXtreme
Solution Sage
Solution Sage

Hi @ChloeDL 

 

It's good you show what you want to accomplish, we appreciate that... but where the piece where you show your data and model?

Thanks for your response. Unfortunately, I work for GCC and cannot give you a screnshot of the data but I'm hoping this helps. Here's the formula we currently use for the cumulative spend. Which works well but doesn't seperate by "bucket of money".  We're using the matrix visuals to show each projects within each budget "bucket" and fiscal years either as columns or as a slicer. 

Cumulative spent = CALCULATE(SUM(Append1[Actual Expenditures]),ALL('Append1'),Append1[FiscalYear] <= MAX('Append1'[FiscalYear]))
 
Here's a screnshot of the relationships made, all of our data is within the Append1 table. 
 
ChloeDL_0-1660996218156.png

 

Here's a copy of our data columns, highlighted are the "used" columns for this requirement. 

ChloeDL_2-1660996742719.pngChloeDL_3-1660996799221.png

Hi there.

 


@ChloeDL wrote:

Basically, we have this huge dataset with individual line items for every transaction which includes prj info, budget, fiscal year etc. First, we need a formula to get the cumulative spent by budget by year. Second we need a formula that will subtract the actuals from given total budget amount again by budget and fiscal. Thing is the dataset doesn’t have budget amounts.

I don't quite get this. In one sentence you say there's budget in the table, in another you say you don't have the budget amounts... Not sure if I can help here 😞

 

 

 

Sorry for not being clear. The budget colum shows the bucket from which each actuals is coming out of (b2018 or b2021). I've tested things and added the TBBudget column which shows the total budget amount but I need it to subtract each actuals 

 

Currently it shows 

 

BudgetActualsTBBudget
B2018

$10

$100
B2018$20$100
B2018$30$100
B2021$40$200
B2021$50$200

 

Where we need it to show 

 

BudgetActualsTBBudget
B2018

10

100-10=90

B201820100-30=70
B201830100-60=40
B202140200-40=160
B202150200-90=110

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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