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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
MLBLom
Frequent Visitor

Looking for assistance with a running total balance for multiple accounting periods using data from

Fairly new to Power BI.  I need to be able to take a ‘projected’ revenue amount  ‘TotalEstimatedRev’[TotalEstimatedRev] from one table as a starting amount for year 2023 - amount is  $73,377,835.88. 

 

For accounting periods 1 – 12 need to have a running total balance with starting amount being ‘TotalEstimatedRev’[TotalEstimatedRev]and add the difference between the (Revenue Booked to Date minus Expended to Date which come from two other tables.

 I have created a measure for the difference called ‘SB_PBI_VS_SB_ADM_REV_TB’[6RevExpDiffNew]. 

The ‘SB_PBI_VS_SB_ADM_REV_TB’[6RevExpDiffNew] amount for a particular accounting period needs to be added to the running total balance amount from the month before.  

 

6REVEXPDIFFNEW =

('SB_PBI_VW_SB_ADM_REV_TB'[TOTALREVwoNegatives]) - ('SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA'[2TotalExpense])

 

More detail behind the measure 6REVEXPDIFFNEW measure:

TOTALREVwonegatives =

CALCULATE(SUM('SB_PBI_VW_SB_ADM_REV_TB'[TOTAL_REV]), FILTER(SB_PBI_VW_SB_ADM_REV_TB, 'SB_PBI_VW_SB_ADM_REV_TB'[TOTAL_REV] >= 0))

 

2TotalExpense = ('SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA'[MTD] + 'SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA'[RUNNINGENCUMBRANCE])

 

RunningEncumbrance =
CALCULATE([3 New Encumbrance Amount],
                   Window(
                       1, ABS,
                   0, REL,
                       SUMMARIZE(ALLSELECTED('SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA'), 'SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA'[ACCOUNTING_PERIOD]),
                       ORDERBY('SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA'[ACCOUNTING_PERIOD])))
 
3 New Encumbrance Amount = CALCULATE(SUM(SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA[TOTAL_EXPENSED_AMT]), FILTER(SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA, SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA[LEDGER]="ORG_EN"))
 
MTD =
VAR MAXACCTPERIOD2='SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA'[MAXACCTPERIOD]
RETURN
CALCULATE(SUM(SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA[TOTAL_EXPENSED_AMT]), FILTER(SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA, SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA[LEDGER]="ORG_EX"), FILTER('SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA', 'SB_PBI_VW_COMBINED_BUDGET_EXPENSE_DATA'[ACCOUNTING_PERIOD]=MAXACCTPERIOD2))
 

Outputs below:

MLBLom_1-1700054931473.png

 

However, my Running Balance/Running Total is not totaling properly. 

 

Below is my current measure for Running balance:

 

Running Balance5 = 'SB_PBI_VW_SB_ADM_REV_TB'[6REVEXPDIFFNEW] + SELECTEDVALUE('TotalRevenueEstimates'[TotalEstimatedRev])

 

Accounting period 1 is correct but periods 2 through 12 are not.

For example   start with the projected amount $73,377.835.88 + $696,521.08 = Acct period 1 $74,074,356.96  (CORRECT)

Acct period 2 – should take the total from acct period 1 $74,074,356.96 +  ($92,862.21) .  This should total $73,981,494.75   but it is calculating Acct period 2 as $73,745,013.16 (incorrect).    All additional periods are incorrect as well.  

MLBLom_2-1700054931475.png

Any guidance would be appreciated.  Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MLBLom ,

 

According to your description, here are my steps you can follow as a solution.

(1) We can create a measure. 

Measure = 
 var _a=CALCULATE([Running Total],FILTER(ALL('Table'),'Table'[Accounting Period]=1))
 var _b=_a+[Difference]
 return 
 IF(MAX('Table'[Accounting Period])=1,[Running Total],_b)

(2) Then the result is as follows.

vtangjiemsft_0-1700188179890.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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 @MLBLom ,

 

According to your description, here are my steps you can follow as a solution.

(1) We can create a measure. 

Measure = 
 var _a=CALCULATE([Running Total],FILTER(ALL('Table'),'Table'[Accounting Period]=1))
 var _b=_a+[Difference]
 return 
 IF(MAX('Table'[Accounting Period])=1,[Running Total],_b)

(2) Then the result is as follows.

vtangjiemsft_0-1700188179890.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors