Forum Discussion
JimB-GA
8 years agoHelper III
Balance value calculation
Good morning all! Still wet behind the ears with Power BI, I'm trying to create a column that maintains a running balance based on date and transaction type. Here is my sample table. My problem...
- 8 years ago
Hi JimB-GA,
Based on my test, you could refer to below steps:
Sample data:
Create two calculated columns:
a = IF([Type]="Debit",-[Amount],[Amount])
Total running = CALCULATE(SUM(Table1[a]),FILTER('Table1','Table1'[Transaction]<=EARLIER(Table1[Transaction])))
And you could see the result:
You can also download the PBIX file to have a view.
https://www.dropbox.com/s/j4kh8ait0z2f69w/Balance%20value%20calculation.pbix?dl=0
Regards,
Daniel He
Zubair_Muhammad
8 years agoCommunity Champion
What is the end result you desire? Could you show it in the sample table
| Date | Transaction | Type | Amount |
| 1/1/2018 | 123 | Credit | 1500 |
| 1/1/2018 | 124 | Debit | 420 |
| 1/3/2018 | 125 | Debit | 360 |
| 1/4/2018 | 126 | Credit | 1650 |
| 1/6/2018 | 127 | Credit | 1200 |
| 1/10/2018 | 128 | Debit | 1000 |
JimB-GA
8 years agoHelper III
Sorry, I should have thought of that earlier!
| Date | Transaction | Type | Amount | Balance |
| 1/1/2018 | 123 | Credit | 1,500 | 1,500 |
| 1/1/2018 | 124 | Debit | 420 | 1,080 |
| 1/3/2018 | 125 | Debit | 360 | 720 |
| 1/4/2018 | 126 | Credit | 1,650 | 2,370 |
| 1/6/2018 | 127 | Credit | 1,200 | 3,570 |
| 1/10/2018 | 128 | Debit | 1,000 | 2,570 |