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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
AA622
Helper II
Helper II

Measure for customer payments over time towards current balance

I am creating an AR report where I need to show payments against a customer account, customer invoice#, and the original amount

 

AA622_3-1683677576103.png

 

The issue Im having is the different payments go toward the original amount of 10,000

 

In the example above the customer made an initial payment of 5,000 lowering the balance to 5,000.

 

Then they made a payment of 1000 which shouldve lowered it to 4,000 but instead it went toward the intial balance of 10,000 making it 9,000

 

How do I create a measure that will take into account the new current balance? Any help would be appreciated

 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@AA622 , You need to have an inventory Approach, when using cumulative amounts. with help from date table

 

CALCULATE(SUM(Table[Amount Due]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Amount Paid]),filter(date,date[date] <=maxx(date,date[date])))

 

We sometimes use intial qty there. But I dobut that will apply here

 

example


Inventory / OnHand
[Intial Inventory] + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] <=maxx(date,date[date])))

Inventory / OnHand
CALCULATE(firstnonblankvalue('Date'[Month]),sum(Table[Intial Inventory]),all('Date')) + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] <=maxx(date,date[date])))

 

refer

Power BI Inventory On Hand
Power BI Inventory On Hand: https://youtu.be/nKbJ9Cpb-Aw

 

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

Hey thanks I tried with the first measure but I still get the same results. This is what I made

 

CurrentBal3 =
CALCULATE(
SUM(Table[OrigAmt3]),
FILTER('Table',Table[Invoice Date] <= MAXX('Table',Table[Invoice Date]))) -
CALCULATE(
SUM(Table[PayymentAmt2]),
FILTER('Table',Table[Invoice Date] <= MAXX('Table',Table[Invoice Date])))
 
 
Should I be using a different parameter for the date portion? I do have a calendar/date table FYI
 
Keep in mind that this is per customer account who has an invoice(bill) which is CSM001400. Original amount is 10,000 and they are making payments over different dates in different increments. In this case its 5,000 and 1,000. Bal should be 4,000

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.