Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
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
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
17 | |
14 | |
12 | |
10 | |
9 |