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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cisrael
New Member

Calculate Balance

Hi all! I am wanting to calculate a balance that will include the previous period's net change (Screenshot below), except for period one. Is this possible to do?

 

cisrael_1-1649871341236.png

 

To add a little more information to my query: 'Net Change' in Period 1 is the Period 1 Balance. What I want to do is take the following Debits - Credit total plus the previous period 'Net Change' to get my balance through period 12.

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @cisrael ,

 

Please try to create a measure like below:

Measure = 
var Balance_ = SUM('Table'[Debit])-SUM('Table'[Credit])
var Period_ = SELECTEDVALUE('Table'[Period ID])
var Debit_ = CALCULATE(SUM('Table'[Debit]),FILTER(ALLEXCEPT('Table','Table'[Account Number]),'Table'[Period ID] = Period_ -1))
var Credit_ = CALCULATE(SUM('Table'[Credit]),FILTER(ALLEXCEPT('Table','Table'[Account Number]),'Table'[Period ID] = Period_ -1))
return Balance_+Debit_-Credit_

Vlianlmsft_0-1650261369029.png

 


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

Hi @V-lianl-msft - thank you very much for your response! I have transferred the suggested measure but I am not getting the correct numbers. I'm sure it is something I am doing wrong, below is the output:

cisrael6_0-1650312070664.pngcisrael6_1-1650312083381.png

 

amitchandak
Super User
Super User

@cisrael , a measure like

M1 = Sum(Table[Debits]) - sum(Table[Credit]) + CALCULATE(SUM(Table[Net Change]),previousmonth('Date'[Date]))

 

Same year =

CALCULATE(SUMX(Values('Date'[Month Year]), [M1] ),DATESYTD('Date'[Date],"12/31"))

 

Rolling 12

Rolling 12 = CALCULATE( SUMX(Values('Date'[Month Year]), [M1] ),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.