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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Pbi07
Helper V
Helper V

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
v-yiruan-msft
Community Support
Community Support

Hi @Pbi07 ,

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yiruan-msft 

 

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.