Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I am trying to calculate Total balance from debit and credit columns. but my formula is not adding debit values and subtracting credit values it's showing same value in balance. it should be customer and date wise (date from older to newer). I will show one customer at a time in my report on user selection based.
Solved! Go to Solution.
@aqsasaleem
Try this measure:
Balance =
CALCULATE (
SUM ( cl_resultset[md_debit] ) - SUM ( cl_resultset[md_credit] ),
WINDOW (
1,
ABS,
0,
REL,
SUMMARIZE (
ALLSELECTED ( cl_resultset ),
cl_resultset[md_date],
cl_resultset[refernce number]
)
)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@aqsasaleem
Please try this measure:
Balance =
CALCULATE ( [Debit Balance], tablename[date] <= MAX ( tablename[date] ) )
- CALCULATE ( [Credit Balance], tablename[date] <= MAX ( tablename[date] ) )
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Fowmy I used your formula it's working but where dates are same (Transactions on same date) it is grouping values. any solution?
Formula is
@aqsasaleem
Try this measure:
Balance =
CALCULATE (
SUM ( cl_resultset[md_debit] ) - SUM ( cl_resultset[md_credit] ),
WINDOW (
1,
ABS,
0,
REL,
SUMMARIZE (
ALLSELECTED ( cl_resultset ),
cl_resultset[md_date],
cl_resultset[refernce number]
)
)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi, @aqsasaleem
try below
Balance =
var a = MAX ( tablename[date] )
var b = CALCULATE ( [Debit Balance], tablename[date] < MAX ( tablename[date] ) )+a
var c = CALCULATE ( [Credit Balance], tablename[date] <= MAX ( tablename[date] ) )+a
return
b-c
This topic is very similar, check it out
Solved: Re: calc balance from debit and credit - Microsoft Fabric Community
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |