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
Anonymous
Not applicable

Balance calculation as of selected date

Need help with a calculation for the balance amount for the customer as of the selected date. 

 

The invoice details and the payment date for the invoices are in the below table 

 

CustomerInvoiceTrans DateAmountPaidPayment DateInvoice Bal
       
11002/2/20235004503/3/202350
11102/20/20232002002/25/20230
21153/10/20234000 400

 

Report need to show the customer with their balance as of the date selected and the balance as of current date

If the selected calendar date is 02/28/2023 , and current date is 03/10/2023 expected result is 

 

CustomerBalanceCurrent Balance
   
150050
2 400

 

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

According to your description, it seems that you want to display the value on the visual base on the date slicer dynamically. But how to calculate it when selected the date is 02/28/2023? It got the values which the payment data is greater than 02/28/2023 and lower than 03/10/2023? Why the current date 03/10/2023? Could you please explain the calculation logic base on the provided sample data? It would be helpful to find the solution. Thank you.

Customer Balance Current Balance
1 500 50
2   400

Best Regards

Anonymous
Not applicable

@Anonymous 

 

I did not do a good job in explaining the above and also there is a major tweak also to the data. 

The base requirement is to provide the balance o

n customer for the date selected. Balance is derived based on the invoices less any receipts. Also need the column for the balance for the month 

 

Here is the invoice table 

CustomerInvoiceInvoice DateValue
CUS1INV-L18/20/2023100
CUS1INV-L28/20/2023150
CUS1INV-19/1/2023500
CUS1INV-29/15/20231000
CUS1INV-39/25/20232000
CUS5INV-610/4/20231100

 

Receipts table - The data can have an advance payment also which should be reflected in the balance

CustomerInvoiceRcpt DateValue
CUS1INV-L19/5/2023-100
CUS1INV-19/1/2023-200
CUS1INV-19/29/2023-200
CUS1INV-29/30/2023-1000
CUS1INV-110/2/2023-50
CUS2ADV-19/20/2023-250

 

If date selected is Aug 31st, expected result 

CustomerBalanceCurrent Month 
CUS1250250
   

 

If date selected is Sep 30th, expected result

CustomerBalanceCurrent Month 
CUS122502100
CUS2-250 

 

For CUS1 , balance of 2250 is INV-L2 (100) + INV-1 (100)  + INV-3 (2000)

Current balance is balance for SEP invoices -   INV-1 (100)  + INV-3 (2000)

 

Pbix is attached 

https://drive.google.com/file/d/1k4aGruU1ObhUurwYHRocYP5QC0Tj2vfq/view?usp=sharing

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 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.